1
/***************************************************************************
2
* Copyright (C) 2003 by Stephen Allewell *
3
* stephen@mirramar.fsnet.co.uk *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
9
***************************************************************************/
11
#ifndef PATTERNPROPERTIESDIALOG_H
12
#define PATTERNPROPERTIESDIALOG_H
14
#include "patternpropertiesdlg.h"
16
/** Wrapper class for PatternPropertiesDlg.ui
17
@author Stephen P. Allewell
19
class PatternPropertiesDialog : public PatternPropertiesDlg
24
@param parent Pointer to the parent object
26
PatternPropertiesDialog(QWidget* parent);
28
/** Reimplemented from the base class.
29
Called before the dialog is shown. Set the values of the dialog box
30
to the member values stored in this class.
33
/** Reset the member values to the users preferred values from the configuration
38
/** Set the units to display the values in.
39
@param sizeUnits The units to use (Stitches|CM|Inches)
41
void setUnits(QString sizeUnits);
42
/** Set the width in stitches of the pattern.
44
void setPatternWidth(int width);
45
/** Set the height in stitches of the pattern.
47
void setPatternHeight(int height);
48
/** Set the size in stitches of the pattern.
50
void setPatternSize(int width,int height);
51
/** Set the cloth count.
52
@param clothCount Cloth count value (value/CM|value/Inch) dependant on the
53
last setting of sizeUnits in CM or Inches.
55
void setClothCount(double clothCount);
56
/** Set the cloth count units.
57
This will be cm or in.
58
@param clothCountUnits The units to be used.
60
void setClothCountUnits(QString clothCountUnits);
62
void setTitle(QString title);
63
void setAuthor(QString author);
64
void setCopyright(QString copyright);
65
void setFabric(QString fabric);
66
void setFabricColor(QColor fabricColor);
67
void setScheme(QString scheme);
68
void setInstructions(QString instructions);
75
QString clothCountUnits();
82
QString instructions();
84
/** Write the values of the pattern properties to the stream
87
friend QDataStream& operator<<(QDataStream&,const PatternPropertiesDialog&);
88
/** Read the values of the pattern properties from the stream
91
friend QDataStream& operator>>(QDataStream&,PatternPropertiesDialog&);
94
/** Reimplemented from base class.
95
Called when the Close button is selected. It is used to check if the
96
'Set as default' checkbox is set and if so will store the values in the
97
dialog to the configuration object.
99
virtual void accept();
100
/** Invoke the context help for this dialog
102
void slotContextHelp();
105
/** Called when the units are changed.
106
Will update the values in width, height and possibly cloth count to relate
108
@param sizeUnits The new units to be used.
110
void slotUnitsChanged(const QString& sizeUnits);
113
/** Calculate the values for display width and height for the dialog
114
box, based on the display units and cloth count values. Set the
115
increment values for the spin boxes dependant on the display units
116
and set the suffix for the cloth count.
118
void calculateSizes(int width,int height,double clothCount,QString clothCountUnits);
120
QString m_sizeDisplayUnits;
122
int m_sizeWidth; // width in stitches
123
int m_sizeHeight; // height in stitches
125
QString m_clothCountUnits;
126
QString m_patternTitle;
127
QString m_patternAuthor;
128
QString m_patternCopyright;
129
QString m_patternFabric;
130
QColor m_fabricColor;
131
QString m_flossScheme;
132
QString m_patternInstructions;
135
#endif // KXSTITCHVIEW_H