Some style cleanup.
This commit is contained in:
+38
-70
@@ -31,83 +31,51 @@ namespace glabels
|
||||
{
|
||||
|
||||
public:
|
||||
BarcodeStyle ()
|
||||
: m_id( "" ),
|
||||
m_name( "" ),
|
||||
m_can_text( false ),
|
||||
m_text_optional( false ),
|
||||
m_can_checksum( false ),
|
||||
m_checksum_optional( false ),
|
||||
m_default_digits( "" ),
|
||||
m_can_freeform( false ),
|
||||
m_prefered_n( 0 )
|
||||
{
|
||||
}
|
||||
BarcodeStyle ();
|
||||
|
||||
BarcodeStyle ( const QString& id,
|
||||
const QString& name,
|
||||
bool canText,
|
||||
bool textOptional,
|
||||
bool canChecksum,
|
||||
bool checksumOptional,
|
||||
const QString& defaultDigits,
|
||||
bool canFreeform,
|
||||
int preferedN );
|
||||
|
||||
|
||||
BarcodeStyle ( const QString &id,
|
||||
const QString &name,
|
||||
bool can_text,
|
||||
bool text_optional,
|
||||
bool can_checksum,
|
||||
bool checksum_optional,
|
||||
const QString &default_digits,
|
||||
bool can_freeform,
|
||||
int prefered_n )
|
||||
: m_id( id ),
|
||||
m_name( name ),
|
||||
m_can_text( can_text ),
|
||||
m_text_optional( text_optional ),
|
||||
m_can_checksum( can_checksum ),
|
||||
m_checksum_optional( checksum_optional ),
|
||||
m_default_digits( default_digits ),
|
||||
m_can_freeform( can_freeform ),
|
||||
m_prefered_n( prefered_n )
|
||||
{
|
||||
}
|
||||
const QString& id() const;
|
||||
|
||||
const QString& name() const;
|
||||
|
||||
bool canText() const;
|
||||
|
||||
bool textOptional() const;
|
||||
|
||||
bool canChecksum() const;
|
||||
|
||||
bool checksumOptional() const;
|
||||
|
||||
const QString& defaultDigits() const;
|
||||
|
||||
bool canFreeform() const;
|
||||
|
||||
int preferedN() const;
|
||||
|
||||
|
||||
QString id() { return m_id; }
|
||||
QString exampleDigits( int n ) const;
|
||||
|
||||
QString name() { return m_name; }
|
||||
|
||||
bool can_text() { return m_can_text; }
|
||||
|
||||
bool text_optional() { return m_text_optional; }
|
||||
|
||||
bool can_checksum() { return m_can_checksum; }
|
||||
|
||||
bool checksum_optional() { return m_checksum_optional; }
|
||||
|
||||
QString default_digits() { return m_default_digits; }
|
||||
|
||||
bool can_freeform() { return m_can_freeform; }
|
||||
|
||||
int prefered_n() { return m_prefered_n; }
|
||||
|
||||
|
||||
QString example_digits( int n )
|
||||
{
|
||||
if ( m_can_freeform )
|
||||
{
|
||||
return QString( std::max( n, 1 ), QChar('0') );
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_default_digits;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_id;
|
||||
QString m_name;
|
||||
bool m_can_text;
|
||||
bool m_text_optional;
|
||||
bool m_can_checksum;
|
||||
bool m_checksum_optional;
|
||||
QString m_default_digits;
|
||||
bool m_can_freeform;
|
||||
int m_prefered_n;
|
||||
QString mId;
|
||||
QString mName;
|
||||
bool mCanText;
|
||||
bool mTextOptional;
|
||||
bool mCanChecksum;
|
||||
bool mChecksumOptional;
|
||||
QString mDefaultDigits;
|
||||
bool mCanFreeform;
|
||||
int mPreferedN;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user