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

akregator

  • sources
  • kde-4.14
  • kdepim
  • akregator
  • src
akregator_part.h
Go to the documentation of this file.
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Stanislav Karchebny <Stanislav.Karchebny@kdemail.net>
5  2005 Frank Osterfeld <osterfeld@kde.org>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of Qt, and distribute the resulting executable,
23  without including the source code for Qt in the source distribution.
24 */
25 
26 #ifndef AKREGATOR_PART_H
27 #define AKREGATOR_PART_H
28 
29 #include <QPointer>
30 #include <QVector>
31 
32 #include <kurl.h>
33 #include <kparts/browserextension.h>
34 #include <kparts/part.h>
35 
36 #ifndef Q_MOC_RUN
37 #include <boost/shared_ptr.hpp>
38 #endif
39 
40 class KConfigGroup;
41 class KUrl;
42 class KCMultiDialog;
43 
44 class QTimer;
45 
46 namespace Akregator {
47 
48 namespace Backend {
49  class Storage;
50 }
51 
52 class Article;
53 class ActionManagerImpl;
54 class Feed;
55 class FeedList;
56 class LoadFeedListCommand;
57 class MainWidget;
58 class Part;
59 class TrayIcon;
60 
61 class BrowserExtension : public KParts::BrowserExtension
62 {
63  Q_OBJECT
64 
65  public:
66  explicit BrowserExtension(Part *p, const char *name=0);
67  public slots:
68  void saveSettings();
69  private:
70  Part *m_part;
71 };
72 
77 class Part : public KParts::ReadOnlyPart
78 {
79  Q_OBJECT
80  public:
81  typedef KParts::ReadOnlyPart inherited;
82 
84  Part(QWidget *parentWidget, QObject *parent, const QVariantList&);
85 
87  ~Part();
88 
93  bool openUrl(const KUrl& url);
94 
96  void openStandardFeedList();
97 
98  void fetchFeedUrl(const QString&);
99 
101  void fetchAllFeeds();
102 
110  void addFeedsToGroup(const QStringList& urls, const QString& group);
111 
112  void addFeed();
113 
120  virtual void readProperties(const KConfigGroup & config);
121 
125  virtual void saveProperties(KConfigGroup & config);
126 
127  void exportFile(const KUrl& url);
128 
129  bool handleCommandLine();
130 
131  public slots:
133  void saveSettings();
134 
136  void slotSaveFeedList();
137 
138  void fileImport();
139  void fileExport();
140 
142  void showOptions();
143  void showNotificationOptions();
144 
146  void slotAutoSave();
147 
148  signals:
149  void signalSettingsChanged();
150  void signalArticlesSelected( const QList<Akregator::Article>& );
151 
152  private:
153 
155  bool isTrayIconEnabled() const;
156 
160  void loadPlugins( const QString& type );
161 
163  bool openFile();
164 
165  void importFile(const KUrl& url);
166 
167  KParts::Part *hitTest(QWidget *widget, const QPoint &globalPos);
168 
169  private slots:
170  void slotStarted();
171 
172  void slotOnShutdown();
173  void slotSettingsChanged();
174  void slotSetStatusText( const QString &statusText );
175 
176  void feedListLoaded( const boost::shared_ptr<Akregator::FeedList>& list );
177 
178  void flushAddFeedRequests();
179 
180  private: // methods
181 
183  void initFonts();
184 
185  bool writeToTextFile( const QString& data, const QString& fname ) const;
186 
187 
191  void autoReadProperties();
192 
197  void autoSaveProperties();
198 
203  void saveCrashProperties();
204 
208  bool readCrashProperties();
209 
213  void clearCrashProperties();
214 
215 
216  private: // attributes
217 
218  class ApplyFiltersInterceptor;
219  ApplyFiltersInterceptor* m_applyFiltersInterceptor;
220  QString m_standardFeedList;
221  bool m_standardListLoaded;
222  bool m_shuttingDown;
223  bool m_doCrashSave;
224 
225  KParts::BrowserExtension *m_extension;
226 
227  QTimer* m_autosaveTimer;
229  bool m_backedUpList;
230  MainWidget* m_mainWidget;
231  Backend::Storage* m_storage;
232  ActionManagerImpl* m_actionManager;
233  KCMultiDialog* m_dialog;
234  struct AddFeedRequest {
235  QStringList urls;
236  QString group;
237  };
238  QPointer<LoadFeedListCommand> m_loadFeedListCommand;
239  QVector<AddFeedRequest> m_requests;
240 };
241 
242 } // namespace Akregator
243 
244 #endif // AKREGATOR_PART_H
QWidget
Akregator::BrowserExtension::BrowserExtension
BrowserExtension(Part *p, const char *name=0)
Akregator::Part::~Part
~Part()
Destructor.
Definition: akregator_part.cpp:390
Akregator::MainWidget
This is the main widget of the view, containing tree view, article list, viewer etc.
Definition: mainwidget.h:68
Akregator::Part::readProperties
virtual void readProperties(const KConfigGroup &config)
This method is called when this app is restored.
Definition: akregator_part.cpp:402
Akregator::Part::saveSettings
void saveSettings()
Used to save settings after changing them from configuration dialog.
Definition: akregator_part.cpp:385
QPointer
Akregator::Part::handleCommandLine
bool handleCommandLine()
Definition: akregator_part.cpp:737
Akregator::Part::signalSettingsChanged
void signalSettingsChanged()
Akregator::Part::addFeedsToGroup
void addFeedsToGroup(const QStringList &urls, const QString &group)
Add a feed to a group.
Definition: akregator_part.cpp:611
Akregator::Backend::Storage
Storage is the main interface to the article archive.
Definition: storage.h:43
QPoint
Akregator::Part
This is a RSS Aggregator "Part".
Definition: akregator_part.h:77
Akregator::Part::saveProperties
virtual void saveProperties(KConfigGroup &config)
This method is called when it is time for the app to save its properties for session management purpo...
Definition: akregator_part.cpp:411
Akregator::Part::signalArticlesSelected
void signalArticlesSelected(const QList< Akregator::Article > &)
Akregator::Part::showNotificationOptions
void showNotificationOptions()
Definition: akregator_part.cpp:626
QTimer
Akregator::Part::Part
Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
Default constructor.
Definition: akregator_part.cpp:200
Akregator::Part::exportFile
void exportFile(const KUrl &url)
Definition: akregator_part.cpp:546
Akregator::ActionManagerImpl
Akregator-specific implementation of the ActionManager interface.
Definition: actionmanagerimpl.h:50
QObject
Akregator::BrowserExtension
Definition: akregator_part.h:61
Akregator::Part::slotSaveFeedList
void slotSaveFeedList()
Saves the standard feed list to it's default location.
Definition: akregator_part.cpp:481
QString
QList< Akregator::Article >
Akregator::Part::fileExport
void fileExport()
Definition: akregator_part.cpp:591
QStringList
Akregator::Part::showOptions
void showOptions()
Shows configuration dialog.
Definition: akregator_part.cpp:632
Akregator::Part::addFeed
void addFeed()
Definition: akregator_part.cpp:621
Akregator::Part::fileImport
void fileImport()
Definition: akregator_part.cpp:581
Akregator::Part::openUrl
bool openUrl(const KUrl &url)
Opens feedlist.
Definition: akregator_part.cpp:420
QVector< AddFeedRequest >
Akregator::Part::fetchAllFeeds
void fetchAllFeeds()
Fetch all feeds in the feed tree.
Definition: akregator_part.cpp:601
Akregator::BrowserExtension::saveSettings
void saveSettings()
Definition: akregator_part.cpp:195
Akregator::Part::fetchFeedUrl
void fetchFeedUrl(const QString &)
Definition: akregator_part.cpp:606
Akregator::Part::slotAutoSave
void slotAutoSave()
Call to auto save.
Definition: akregator_part.cpp:812
Akregator::Part::openStandardFeedList
void openStandardFeedList()
Opens standard feedlist.
Definition: akregator_part.cpp:426
Akregator::Part::inherited
KParts::ReadOnlyPart inherited
Definition: akregator_part.h:81
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akregator

Skip menu "akregator"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

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