summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/cardview.cpp
Unidiff
Diffstat (limited to 'kaddressbook/views/cardview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/cardview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/kaddressbook/views/cardview.cpp b/kaddressbook/views/cardview.cpp
index da552c3..03df444 100644
--- a/kaddressbook/views/cardview.cpp
+++ b/kaddressbook/views/cardview.cpp
@@ -133,98 +133,98 @@ class CardViewSeparator
133}; 133};
134 134
135//END Helpers 135//END Helpers
136 136
137//BEGIN Private Data 137//BEGIN Private Data
138 138
139class CardViewPrivate 139class CardViewPrivate
140{ 140{
141 public: 141 public:
142 CardViewPrivate() 142 CardViewPrivate()
143 : mSelectionMode( CardView::Multi ), 143 : mSelectionMode( CardView::Multi ),
144 mDrawCardBorder( true ), 144 mDrawCardBorder( true ),
145 mDrawFieldLabels( true ), 145 mDrawFieldLabels( true ),
146 mDrawSeparators( true), 146 mDrawSeparators( true),
147 mSepWidth( 2 ), 147 mSepWidth( 2 ),
148 mShowEmptyFields( false ), 148 mShowEmptyFields( false ),
149 mLayoutDirty( true ), 149 mLayoutDirty( true ),
150 mLastClickOnItem( false ), 150 mLastClickOnItem( false ),
151 mItemMargin( 0 ), 151 mItemMargin( 0 ),
152 mItemSpacing( 10 ), 152 mItemSpacing( 10 ),
153 mItemWidth( 200 ), 153 mItemWidth( 200 ),
154 mMaxFieldLines( INT_MAX ), 154 mMaxFieldLines( INT_MAX ),
155 mCurrentItem( 0L ), 155 mCurrentItem( 0L ),
156 mLastClickPos( QPoint(0, 0) ), 156 mLastClickPos( QPoint(0, 0) ),
157 mResizeAnchor(0),
157 mRubberBandAnchor( 0 ), 158 mRubberBandAnchor( 0 ),
158 mCompText( QString::null ), 159 mCompText( QString::null )
159 mResizeAnchor(0)
160 {}; 160 {};
161 161
162 CardViewItemList mItemList; 162 CardViewItemList mItemList;
163 QPtrList<CardViewSeparator> mSeparatorList; 163 QPtrList<CardViewSeparator> mSeparatorList;
164 QFontMetrics *mFm; 164 QFontMetrics *mFm;
165 QFontMetrics *mBFm; // bold font 165 QFontMetrics *mBFm; // bold font
166 QFont mHeaderFont; // custom header font 166 QFont mHeaderFont; // custom header font
167 CardView::SelectionMode mSelectionMode; 167 CardView::SelectionMode mSelectionMode;
168 bool mDrawCardBorder; 168 bool mDrawCardBorder;
169 bool mDrawFieldLabels; 169 bool mDrawFieldLabels;
170 bool mDrawSeparators; 170 bool mDrawSeparators;
171 int mSepWidth; 171 int mSepWidth;
172 bool mShowEmptyFields; 172 bool mShowEmptyFields;
173 bool mLayoutDirty; 173 bool mLayoutDirty;
174 bool mLastClickOnItem; 174 bool mLastClickOnItem;
175 uint mItemMargin; // internal margin in items 175 uint mItemMargin; // internal margin in items
176 uint mItemSpacing; // spacing between items, column seperators and border 176 uint mItemSpacing; // spacing between items, column seperators and border
177 int mItemWidth; // width of all items 177 int mItemWidth; // width of all items
178 uint mMaxFieldLines; // Max lines to dispaly pr field 178 uint mMaxFieldLines; // Max lines to dispaly pr field
179 CardViewItem *mCurrentItem; 179 CardViewItem *mCurrentItem;
180 QPoint mLastClickPos; 180 QPoint mLastClickPos;
181 QTimer *mTimer; // times out if mouse rests for more than 500 msecs 181 QTimer *mTimer; // times out if mouse rests for more than 500 msecs
182 CardViewTip *mTip; // passed to the item under a resting cursor to display full text 182 CardViewTip *mTip; // passed to the item under a resting cursor to display full text
183 bool mOnSeparator; // set/reset on mouse movement 183 bool mOnSeparator; // set/reset on mouse movement
184 // for resizing by dragging the separators 184 // for resizing by dragging the separators
185 int mResizeAnchor; // uint, ulong? the mouse down separator left 185 int mResizeAnchor; // uint, ulong? the mouse down separator left
186 int mRubberBandAnchor; // for erasing rubber bands 186 int mRubberBandAnchor; // for erasing rubber bands
187 // data used for resizing. 187 // data used for resizing.
188 // as they are beeded by each mouse move while resizing, we store them here, 188 // as they are beeded by each mouse move while resizing, we store them here,
189 // saving 8 calculations in each mouse move. 189 // saving 8 calculations in each mouse move.
190 int colspace; // amount of space between items pr column 190 int colspace; // amount of space between items pr column
191 uint first; // the first col to anchor at for painting rubber bands 191 uint first; // the first col to anchor at for painting rubber bands
192 int firstX; // X position of first in pixel 192 int firstX; // X position of first in pixel
193 int pressed; // the colummn that was pressed on at resizing start 193 int pressed; // the colummn that was pressed on at resizing start
194 int span; // pressed - first 194 int span; // pressed - first
195 // key completion 195 // key completion
196 QString mCompText; // current completion string 196 QString mCompText; // current completion string
197 QDateTime mCompUpdated; // ...was updated at this time 197 QDateTime mCompUpdated; // ...was updated at this time
198}; 198};
199 199
200class CardViewItemPrivate 200class CardViewItemPrivate
201{ 201{
202 public: 202 public:
203 CardViewItemPrivate() : 203 CardViewItemPrivate() :
204 mSelected( false ),
204 x( 0 ), 205 x( 0 ),
205 y( 0 ), 206 y( 0 ){};
206 mSelected( false ){};
207 207
208 208
209 QString mCaption; 209 QString mCaption;
210 QPtrList< CardViewItem::Field > mFieldList; 210 QPtrList< CardViewItem::Field > mFieldList;
211 bool mSelected; 211 bool mSelected;
212 int x; // horizontal position, set by the view 212 int x; // horizontal position, set by the view
213 int y; // vertical position, set by the view 213 int y; // vertical position, set by the view
214 int maxLabelWidth; // the width of the widest label, according to the view font. 214 int maxLabelWidth; // the width of the widest label, according to the view font.
215 int hcache; // height cache 215 int hcache; // height cache
216}; 216};
217//END Private Data 217//END Private Data
218 218
219//BEGIN CardViewItem 219//BEGIN CardViewItem
220 220
221CardViewItem::CardViewItem(CardView *parent, QString caption) 221CardViewItem::CardViewItem(CardView *parent, QString caption)
222 : d(new CardViewItemPrivate()), mView(parent) 222 : d(new CardViewItemPrivate()), mView(parent)
223{ 223{
224 d->mCaption = caption; 224 d->mCaption = caption;
225 225
226 initialize(); 226 initialize();
227} 227}
228 228
229CardViewItem::~CardViewItem() 229CardViewItem::~CardViewItem()
230{ 230{