25 #ifndef __KSUBSCRIPTION
26 #define __KSUBSCRIPTION
28 #include <tqlistview.h>
29 #include <tqcheckbox.h>
31 #include <kdialogbase.h>
32 #include <tdemacros.h>
33 #include "kfoldertree.h"
45 class TDE_EXPORT KGroupInfo
55 KGroupInfo(
const TQString &name,
const TQString &description = TQString(),
56 bool newGroup =
false,
bool subscribed =
false,
57 Status status = unknown, TQString path = TQString() );
59 TQString name, description;
60 bool newGroup, subscribed;
64 bool operator== (
const KGroupInfo &gi2);
65 bool operator< (
const KGroupInfo &gi2);
76 bool isCheckItem =
false );
78 bool isCheckItem =
false );
83 KGroupInfo
info() {
return mInfo; }
84 void setInfo( KGroupInfo info );
90 void setOriginalParent( TQListViewItem* parent ) { mOriginalParent = parent; }
96 void setLastOpenState(
bool last ) { mLastOpenState = last; }
102 virtual void setDescription();
113 void setIgnoreStateChange(
bool ignore ) { mIgnoreStateChange = ignore; }
119 virtual void setOn(
bool on );
125 virtual void stateChange(
bool on );
131 void setVisible(
bool b );
137 virtual void paintCell( TQPainter * p,
const TQColorGroup & cg,
138 int column,
int width,
int align );
144 virtual void paintFocus( TQPainter *,
const TQColorGroup & cg,
151 virtual int width(
const TQFontMetrics&,
const TQListView*,
int column)
const;
157 virtual void setup();
160 virtual int rtti ()
const {
return 15689; }
165 TQListViewItem* mOriginalParent;
171 bool mIgnoreStateChange;
202 KSubscription( TQWidget *parent,
const TQString &caption, KAccount* acct,
203 int buttons = 0,
const TQString &user1 = TQString(),
204 bool descriptionColumn =
true );
212 void setAccount( KAccount * acct ) { mAcct = acct; }
227 void setStartItem(
const KGroupInfo &info );
232 void removeListItem( TQListView *view,
const KGroupInfo &gi );
238 TQListViewItem* getListItem( TQListView *view,
const KGroupInfo &gi );
243 bool itemInListView( TQListView *view,
const KGroupInfo &gi );
249 void changeItemState(
GroupItem* item,
bool on );
255 void setDirectionButton1( Direction dir );
261 void setDirectionButton2( Direction dir );
283 void filterChanged( TQListViewItem* item = 0,
284 const TQString & text = TQString() );
289 uint activeItemCount();
294 void restoreOriginalParent();
299 void saveOpenStates();
304 void restoreOpenStates();
311 void slotLoadingComplete();
316 void slotChangeButtonState( TQListViewItem* );
327 void slotUpdateStatusLabel();
332 void slotLoadFolders();
338 void slotCBToggled();
343 void slotFilterTextChanged(
const TQString & text );
359 TQListView *groupView;
360 TQListView *subView, *unsubView;
361 KLineEdit *filterEdit;
362 TQCheckBox *noTreeCB, *subCB, *newCB;
363 TQPushButton *arrowBtn1, *arrowBtn2;
364 TQIconSet pmRight, pmLeft;
366 TQLabel *leftLabel, *rightLabel;
A class representing a single group item (what's that?)
bool isCheckItem() const
Get if this is a checkable item.
bool ignoreStateChange()
Get/Set if state changes should be ignored.
KGroupInfo info()
Get/Set the KGroupInfo.
TQListViewItem * originalParent()
Get/Set the original parent.
virtual int rtti() const
Reimplemented.
bool lastOpenState()
Get/Set the last open state.
This class provides a generic subscription widget The dialog itself has a main listview that holds al...
void hideTreeCheckbox()
Hide 'Disable tree view' checkbox.
bool isLoading()
Returns true if items are being constructed Call 'slotLoadingComplete' to switch this.
KAccount * account()
Get/Set the account.
KLineEdit * searchField()
Access to the searchfield.
Direction
The direction of the buttons.
void listChanged()
Emitted when the amount of items in the groupView changes (e.g.
Direction directionButton1()
Get/Set the direction of button1.
TQListView * folderTree()
Access to the treewidget that holds the GroupItems.
Direction directionButton2()
Get/Set the direction of button2.
void hideNewOnlyCheckbox()
Hide 'New Only' checkbox.