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

knode

  • sources
  • kde-4.12
  • 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 #include <boost/shared_ptr.hpp>
19 #include <QString>
20 
21 class KNCollectionViewItem;
22 
23 
30 class KNCollection {
31 
32  public:
33  enum collectionType { CTnntpAccount, CTgroup,
34  CTfolder, CTcategory,
35  CTvirtualGroup };
36 
40  typedef boost::shared_ptr<KNCollection> Ptr;
41 
42 
46  explicit KNCollection( KNCollection::Ptr p );
47  virtual ~KNCollection();
48 
50  virtual collectionType type() = 0;
51 
55  KNCollectionViewItem* listItem() const { return l_istItem; }
59  void setListItem(KNCollectionViewItem *i);
61  virtual void updateListItem();
62 
63  // info
64  virtual QString path() = 0;
66  virtual bool readInfo( const QString &confPath ) = 0;
68  virtual void writeConfig() = 0;
69 
71  KNCollection::Ptr parent() const { return p_arent; }
73  virtual void setParent( KNCollection::Ptr p ) { p_arent = p; }
74 
76  virtual const QString& name() { return n_ame; }
78  void setName( const QString &s ) { n_ame = s; }
79 
80  // count
81  int count()const { return c_ount; }
82  void setCount(int i) { c_ount=i; }
83  void incCount(int i) { c_ount+=i; }
84  void decCount(int i) { c_ount-=i; }
85 
86  protected:
90  virtual KNCollection::Ptr selfPtr() = 0;
91 
93  KNCollection::Ptr p_arent;
95  KNCollectionViewItem *l_istItem;
97  QString n_ame;
98  int c_ount;
99 
100 };
101 
102 #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:35
KNCollection::parent
KNCollection::Ptr parent() const
Returns the parent collection.
Definition: kncollection.h:71
KNCollection::p_arent
KNCollection::Ptr p_arent
A pointer to the parent collection.
Definition: kncollection.h:93
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:78
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:83
KNCollection::name
virtual const QString & name()
Returns the collection name.
Definition: kncollection.h:76
KNCollection::n_ame
QString n_ame
The name of this collection.
Definition: kncollection.h:97
KNCollection
Abstract base class for everything that is visible in the folder tree.
Definition: kncollection.h:30
KNCollection::CTcategory
Definition: kncollection.h:34
KNCollection::count
int count() const
Definition: kncollection.h:81
KNCollection::listItem
KNCollectionViewItem * listItem() const
Returns the listview item representing this collection in the folder tree.
Definition: kncollection.h:55
KNCollection::l_istItem
KNCollectionViewItem * l_istItem
The list view item representing this collection in the folder tree.
Definition: kncollection.h:95
KNCollection::setCount
void setCount(int i)
Definition: kncollection.h:82
KNCollection::setParent
virtual void setParent(KNCollection::Ptr p)
Sets the parent collection.
Definition: kncollection.h:73
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:84
KNCollection::CTgroup
Definition: kncollection.h:33
KNCollection::path
virtual QString path()=0
KNCollection::Ptr
boost::shared_ptr< KNCollection > Ptr
Shared pointer to a KNCollection.
Definition: kncollection.h:40
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:34
KNCollection::c_ount
int c_ount
Definition: kncollection.h:98
KNCollection::collectionType
collectionType
Definition: kncollection.h:33
KNCollectionViewItem
Folder tree item.
Definition: kncollectionviewitem.h:25
KNCollection::CTnntpAccount
Definition: kncollection.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:36 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

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