~ubuntu-branches/debian/sid/kxstitch/sid

« back to all changes in this revision

Viewing changes to kxstitch/patternpropertiesdialog.h

  • Committer: Bazaar Package Importer
  • Author(s): eric pareja
  • Date: 2005-02-19 12:37:22 UTC
  • Revision ID: james.westby@ubuntu.com-20050219123722-kt3ru1nqvllietee
Tags: upstream-0.6
ImportĀ upstreamĀ versionĀ 0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2003 by Stephen Allewell                                *
 
3
 *   stephen@mirramar.fsnet.co.uk                                          *
 
4
 *                                                                         *
 
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
 ***************************************************************************/
 
10
 
 
11
#ifndef PATTERNPROPERTIESDIALOG_H
 
12
#define PATTERNPROPERTIESDIALOG_H
 
13
 
 
14
#include "patternpropertiesdlg.h"
 
15
 
 
16
/** Wrapper class for PatternPropertiesDlg.ui
 
17
    @author Stephen P. Allewell
 
18
  */
 
19
class PatternPropertiesDialog : public PatternPropertiesDlg
 
20
{
 
21
  Q_OBJECT
 
22
public:
 
23
/** Constructor
 
24
    @param parent Pointer to the parent object
 
25
  */
 
26
  PatternPropertiesDialog(QWidget* parent);
 
27
 
 
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.
 
31
  */
 
32
  virtual void show();
 
33
/** Reset the member values to the users preferred values from the configuration
 
34
    object.
 
35
  */
 
36
  void reset();
 
37
 
 
38
/** Set the units to display the values in.
 
39
    @param sizeUnits The units to use (Stitches|CM|Inches)
 
40
  */
 
41
  void setUnits(QString sizeUnits);
 
42
/** Set the width in stitches of the pattern.
 
43
  */
 
44
  void setPatternWidth(int width);
 
45
/** Set the height in stitches of the pattern.
 
46
  */
 
47
  void setPatternHeight(int height);
 
48
/** Set the size in stitches of the pattern.
 
49
  */
 
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.
 
54
  */
 
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.
 
59
  */
 
60
  void setClothCountUnits(QString clothCountUnits);
 
61
 
 
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);
 
69
 
 
70
  QString units();
 
71
  int patternWidth();
 
72
  int patternHeight();
 
73
  QSize patternSize();
 
74
  double clothCount();
 
75
  QString clothCountUnits();
 
76
  QString title();
 
77
  QString author();
 
78
  QString copyright();
 
79
  QString fabric();
 
80
  QColor fabricColor();
 
81
  QString scheme();
 
82
  QString instructions();
 
83
 
 
84
/** Write the values of the pattern properties to the stream
 
85
    [Non member function]
 
86
  */
 
87
  friend QDataStream& operator<<(QDataStream&,const PatternPropertiesDialog&);
 
88
/** Read the values of the pattern properties from the stream
 
89
    [Non member function]
 
90
  */
 
91
  friend QDataStream& operator>>(QDataStream&,PatternPropertiesDialog&);
 
92
 
 
93
protected slots:
 
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.
 
98
  */
 
99
  virtual void accept();
 
100
/** Invoke the context help for this dialog
 
101
  */
 
102
  void slotContextHelp();
 
103
 
 
104
private slots:
 
105
/** Called when the units are changed.
 
106
    Will update the values in width, height and possibly cloth count to relate
 
107
    to the new units.
 
108
    @param sizeUnits The new units to be used.
 
109
  */
 
110
  void slotUnitsChanged(const QString& sizeUnits);
 
111
 
 
112
private:
 
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.
 
117
  */
 
118
  void calculateSizes(int width,int height,double clothCount,QString clothCountUnits);
 
119
 
 
120
  QString m_sizeDisplayUnits;
 
121
  QString m_sizeUnits;
 
122
  int     m_sizeWidth;    // width in stitches
 
123
  int     m_sizeHeight;   // height in stitches
 
124
  double  m_clothCount;
 
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;
 
133
};
 
134
 
 
135
#endif // KXSTITCHVIEW_H