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

akregator

  • sources
  • kde-4.12
  • 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 #include <boost/shared_ptr.hpp>
37 
38 class KConfigGroup;
39 class KUrl;
40 class KCMultiDialog;
41 
42 class QDomDocument;
43 class QTimer;
44 
45 namespace Akregator {
46 
47 namespace Backend {
48  class Storage;
49 }
50 
51 class Article;
52 class ActionManagerImpl;
53 class Feed;
54 class FeedList;
55 class LoadFeedListCommand;
56 class MainWidget;
57 class Part;
58 class TrayIcon;
59 
60 class BrowserExtension : public KParts::BrowserExtension
61 {
62  Q_OBJECT
63 
64  public:
65  explicit BrowserExtension(Part *p, const char *name=0);
66  public slots:
67  void saveSettings();
68  private:
69  Part *m_part;
70 };
71 
76 class Part : public KParts::ReadOnlyPart
77 {
78  Q_OBJECT
79  public:
80  typedef KParts::ReadOnlyPart inherited;
81 
83  Part(QWidget *parentWidget, QObject *parent, const QVariantList&);
84 
86  ~Part();
87 
92  bool openUrl(const KUrl& url);
93 
95  void openStandardFeedList();
96 
97  void fetchFeedUrl(const QString&);
98 
100  void fetchAllFeeds();
101 
109  void addFeedsToGroup(const QStringList& urls, const QString& group);
110 
111  void addFeed();
112 
119  virtual void readProperties(const KConfigGroup & config);
120 
124  virtual void saveProperties(KConfigGroup & config);
125 
126  void exportFile(const KUrl& url);
127 
128  bool handleCommandLine();
129 
130  public slots:
132  void saveSettings();
133 
135  void slotSaveFeedList();
136 
137  void fileImport();
138  void fileExport();
139 
141  void showOptions();
142  void showNotificationOptions();
143 
145  void slotAutoSave();
146 
147  signals:
148  void signalSettingsChanged();
149  void signalArticlesSelected( const QList<Akregator::Article>& );
150 
151  private:
152 
154  bool isTrayIconEnabled() const;
155 
159  void loadPlugins( const QString& type );
160 
162  bool openFile();
163 
164  void importFile(const KUrl& url);
165 
166  KParts::Part *hitTest(QWidget *widget, const QPoint &globalPos);
167 
168  private slots:
169  void slotStarted();
170 
171  void slotOnShutdown();
172  void slotSettingsChanged();
173  void slotSetStatusText( const QString &statusText );
174 
175  void feedListLoaded( const boost::shared_ptr<Akregator::FeedList>& list );
176 
177  void flushAddFeedRequests();
178 
179  private: // methods
180 
182  void initFonts();
183 
184  bool writeToTextFile( const QString& data, const QString& fname ) const;
185 
186 
190  void autoReadProperties();
191 
196  void autoSaveProperties();
197 
202  void saveCrashProperties();
203 
207  bool readCrashProperties();
208 
212  void clearCrashProperties();
213 
214 
215  private: // attributes
216 
217  class ApplyFiltersInterceptor;
218  ApplyFiltersInterceptor* m_applyFiltersInterceptor;
219  QString m_standardFeedList;
220  bool m_standardListLoaded;
221  bool m_shuttingDown;
222  bool m_doCrashSave;
223 
224  KParts::BrowserExtension *m_extension;
225 
226  QTimer* m_autosaveTimer;
228  bool m_backedUpList;
229  MainWidget* m_mainWidget;
230  Backend::Storage* m_storage;
231  ActionManagerImpl* m_actionManager;
232  KCMultiDialog* m_dialog;
233  struct AddFeedRequest {
234  QStringList urls;
235  QString group;
236  };
237  QPointer<LoadFeedListCommand> m_loadFeedListCommand;
238  QVector<AddFeedRequest> m_requests;
239 };
240 
241 } // namespace Akregator
242 
243 #endif // AKREGATOR_PART_H
Akregator::BrowserExtension::BrowserExtension
BrowserExtension(Part *p, const char *name=0)
Akregator::Part::~Part
~Part()
Destructor.
Definition: akregator_part.cpp:391
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:400
Akregator::Part::saveSettings
void saveSettings()
Used to save settings after changing them from configuration dialog.
Definition: akregator_part.cpp:386
QWidget
Akregator::Part::handleCommandLine
bool handleCommandLine()
Definition: akregator_part.cpp:735
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:609
Akregator::Backend::Storage
Storage is the main interface to the article archive.
Definition: storage.h:43
Akregator::Part
This is a RSS Aggregator "Part".
Definition: akregator_part.h:76
QObject
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:409
Akregator::Part::signalArticlesSelected
void signalArticlesSelected(const QList< Akregator::Article > &)
Akregator::Part::showNotificationOptions
void showNotificationOptions()
Definition: akregator_part.cpp:624
Akregator::Part::Part
Part(QWidget *parentWidget, QObject *parent, const QVariantList &)
Default constructor.
Definition: akregator_part.cpp:201
Akregator::Part::exportFile
void exportFile(const KUrl &url)
Definition: akregator_part.cpp:544
Akregator::ActionManagerImpl
Akregator-specific implementation of the ActionManager interface.
Definition: actionmanagerimpl.h:50
Akregator::BrowserExtension
Definition: akregator_part.h:60
Akregator::Part::slotSaveFeedList
void slotSaveFeedList()
Saves the standard feed list to it's default location.
Definition: akregator_part.cpp:479
Akregator::Part::fileExport
void fileExport()
Definition: akregator_part.cpp:589
Akregator::Part::showOptions
void showOptions()
Shows configuration dialog.
Definition: akregator_part.cpp:630
Akregator::Part::addFeed
void addFeed()
Definition: akregator_part.cpp:619
Akregator::Part::fileImport
void fileImport()
Definition: akregator_part.cpp:579
Akregator::Part::openUrl
bool openUrl(const KUrl &url)
Opens feedlist.
Definition: akregator_part.cpp:418
Akregator::Part::fetchAllFeeds
void fetchAllFeeds()
Fetch all feeds in the feed tree.
Definition: akregator_part.cpp:599
Akregator::BrowserExtension::saveSettings
void saveSettings()
Definition: akregator_part.cpp:196
Akregator::Part::fetchFeedUrl
void fetchFeedUrl(const QString &)
Definition: akregator_part.cpp:604
Akregator::Part::slotAutoSave
void slotAutoSave()
Call to auto save.
Definition: akregator_part.cpp:810
Akregator::Part::openStandardFeedList
void openStandardFeedList()
Opens standard feedlist.
Definition: akregator_part.cpp:424
Akregator::Part::inherited
KParts::ReadOnlyPart inherited
Definition: akregator_part.h:80
QList< Akregator::Article >
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:58:14 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

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