• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

knode

  • sources
  • kde-4.14
  • kdepim
  • knode
kncollection.h
Go to the documentation of this file.
1 /*
2  KNode, the KDE newsreader
3  Copyright (c) 1999-2005 the KNode authors.
4  See file AUTHORS for details
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  You should have received a copy of the GNU General Public License
11  along with this program; if not, write to the Free Software Foundation,
12  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
13 */
14 
15 #ifndef KNCOLLECTION_H
16 #define KNCOLLECTION_H
17 
18 #ifndef Q_MOC_RUN
19 #include <boost/shared_ptr.hpp>
20 #endif
21 #include <QString>
22 
23 class KNCollectionViewItem;
24 
25 
32 class KNCollection {
33 
34  public:
35  enum collectionType { CTnntpAccount, CTgroup,
36  CTfolder, CTcategory,
37  CTvirtualGroup };
38 
42  typedef boost::shared_ptr<KNCollection> Ptr;
43 
44 
48  explicit KNCollection( KNCollection::Ptr p );
49  virtual ~KNCollection();
50 
52  virtual collectionType type() = 0;
53 
57  KNCollectionViewItem* listItem() const { return l_istItem; }
61  void setListItem(KNCollectionViewItem *i);
63  virtual void updateListItem();
64 
65  // info
66  virtual QString path() = 0;
68  virtual bool readInfo( const QString &confPath ) = 0;
70  virtual void writeConfig() = 0;
71 
73  KNCollection::Ptr parent() const { return p_arent; }
75  virtual void setParent( KNCollection::Ptr p ) { p_arent = p; }
76 
78  virtual const QString& name() { return n_ame; }
80  void setName( const QString &s ) { n_ame = s; }
81 
82  // count
83  int count()const { return c_ount; }
84  void setCount(int i) { c_ount=i; }
85  void incCount(int i) { c_ount+=i; }
86  void decCount(int i) { c_ount-=i; }
87 
88  protected:
92  virtual KNCollection::Ptr selfPtr() = 0;
93 
95  KNCollection::Ptr p_arent;
97  KNCollectionViewItem *l_istItem;
99  QString n_ame;
100  int c_ount;
101 
102 };
103 
104 #endif
KNCollection::selfPtr
virtual KNCollection::Ptr selfPtr()=0
Returns a shared pointer pointing to this collection.
KNCollection::type
virtual collectionType type()=0
Returns the collection type.
KNCollection::CTvirtualGroup
Definition: kncollection.h:37
KNCollection::parent
KNCollection::Ptr parent() const
Returns the parent collection.
Definition: kncollection.h:73
KNCollection::p_arent
KNCollection::Ptr p_arent
A pointer to the parent collection.
Definition: kncollection.h:95
KNCollection::KNCollection
KNCollection(KNCollection::Ptr p)
Create a new collection.
Definition: kncollection.cpp:18
KNCollection::setName
void setName(const QString &s)
Sets the collection name.
Definition: kncollection.h:80
KNCollection::updateListItem
virtual void updateListItem()
Updates the listview item after the collection has changed.
Definition: kncollection.cpp:45
KNCollection::incCount
void incCount(int i)
Definition: kncollection.h:85
KNCollection::name
virtual const QString & name()
Returns the collection name.
Definition: kncollection.h:78
KNCollection::n_ame
QString n_ame
The name of this collection.
Definition: kncollection.h:99
KNCollection
Abstract base class for everything that is visible in the folder tree.
Definition: kncollection.h:32
KNCollection::CTcategory
Definition: kncollection.h:36
KNCollection::count
int count() const
Definition: kncollection.h:83
KNCollection::listItem
KNCollectionViewItem * listItem() const
Returns the listview item representing this collection in the folder tree.
Definition: kncollection.h:57
KNCollection::l_istItem
KNCollectionViewItem * l_istItem
The list view item representing this collection in the folder tree.
Definition: kncollection.h:97
KNCollection::setCount
void setCount(int i)
Definition: kncollection.h:84
KNCollection::setParent
virtual void setParent(KNCollection::Ptr p)
Sets the parent collection.
Definition: kncollection.h:75
QString
KNCollection::~KNCollection
virtual ~KNCollection()
Definition: kncollection.cpp:27
KNCollection::readInfo
virtual bool readInfo(const QString &confPath)=0
Load the properties/settings of this collection.
KNCollection::decCount
void decCount(int i)
Definition: kncollection.h:86
KNCollection::CTgroup
Definition: kncollection.h:35
KNCollection::path
virtual QString path()=0
KNCollection::Ptr
boost::shared_ptr< KNCollection > Ptr
Shared pointer to a KNCollection.
Definition: kncollection.h:42
KNCollection::setListItem
void setListItem(KNCollectionViewItem *i)
Sets the listview item which represents this collection in the folder tree.
Definition: kncollection.cpp:34
KNCollection::writeConfig
virtual void writeConfig()=0
Save the properties/settings of this collection.
KNCollection::CTfolder
Definition: kncollection.h:36
KNCollection::c_ount
int c_ount
Definition: kncollection.h:100
KNCollection::collectionType
collectionType
Definition: kncollection.h:35
KNCollectionViewItem
Folder tree item.
Definition: kncollectionviewitem.h:25
KNCollection::CTnntpAccount
Definition: kncollection.h:35
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

knode

Skip menu "knode"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal