Warning: That file was not part of the compilation database. It may have many parsing errors.
1 | /* |
---|---|
2 | This file is part of the kblog library. |
3 | |
4 | Copyright (c) 2007 Mike McQuaid <mike@mikemcquaid.com> |
5 | |
6 | This library is free software; you can redistribute it and/or |
7 | modify it under the terms of the GNU Library General Public |
8 | License as published by the Free Software Foundation; either |
9 | version 2 of the License, or (at your option) any later version. |
10 | |
11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. |
15 | |
16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 | Boston, MA 02110-1301, USA. |
20 | */ |
21 | |
22 | #ifndef KBLOG_LIVEJOURNAL_H |
23 | #define KBLOG_LIVEJOURNAL_H |
24 | |
25 | #include <kblog/blog.h> |
26 | |
27 | #include <QColor> |
28 | |
29 | class KUrl; |
30 | |
31 | /** |
32 | @file |
33 | This file is part of the for accessing Blog Servers |
34 | and defines the LiveJournal class. |
35 | |
36 | @author Mike McQuaid \<mike\@mikemcquaid.com\> |
37 | */ |
38 | namespace KBlog { |
39 | |
40 | class LiveJournalPrivate; |
41 | |
42 | /** |
43 | @brief |
44 | A class that can be used for access to Movable Type blogs. Almost every |
45 | blog server supports Movable Type . Blah blah |
46 | @code |
47 | Blog* myblog = new LiveJournal("http://example.com/xmlrpc/gateway.php"); |
48 | KBlog::BlogPost *post = new BlogPost(); |
49 | post->setUserId( "some_user_id" ); |
50 | post->setTitle( "This is the title." ); |
51 | post->setContent( "Here is some the content..." ); |
52 | myblog->createPost( post ); |
53 | @endcode |
54 | |
55 | @author Mike McQuaid \<mike\@mikemcquaid.com\> |
56 | */ |
57 | class KBLOG_EXPORT LiveJournal : public Blog |
58 | { |
59 | Q_OBJECT |
60 | public: |
61 | /** |
62 | Create an object for Movable Type |
63 | |
64 | @param server is the url for the xmlrpc gateway. |
65 | @param parent is the parent object. |
66 | */ |
67 | explicit LiveJournal( const KUrl &server, QObject *parent = 0 ); |
68 | |
69 | /** |
70 | Destroy the object. |
71 | */ |
72 | virtual ~LiveJournal(); |
73 | |
74 | virtual void addFriend( const QString &username, int group, |
75 | const QColor &fgcolor = QColor( "#000000"), |
76 | const QColor &bgcolor = QColor( "#FFFFFF") ); |
77 | |
78 | virtual void assignFriendToCategory( const QString &username, int category ); |
79 | |
80 | /** |
81 | Create a new post on server. |
82 | |
83 | @param post is send to the server. |
84 | */ |
85 | void createPost( KBlog::BlogPost *post ); |
86 | |
87 | virtual void deleteFriend( const QString &username ); |
88 | |
89 | /** |
90 | Fetch the Post with postId. |
91 | @param postId is the id of the post on the server. |
92 | |
93 | @see void fetchedPost( KBlog::BlogPost &post ) |
94 | */ |
95 | void fetchPost( KBlog::BlogPost *post ); |
96 | |
97 | virtual void fetchUserInfo(); |
98 | |
99 | QString fullName() const; |
100 | |
101 | /** |
102 | Returns the of the inherited object. |
103 | */ |
104 | QString interfaceName() const; |
105 | |
106 | void listCategories(); |
107 | |
108 | virtual void listFriends(); |
109 | |
110 | virtual void listFriendsOf(); |
111 | |
112 | virtual void listMoods(); |
113 | |
114 | virtual void listPictureKeywords(); |
115 | |
116 | /** |
117 | List recent posts on the server. |
118 | @see void listedPost( KBlog::BlogPost &post ) |
119 | |
120 | @see void listRecentPostsFinished() |
121 | */ |
122 | void listRecentPosts( int number ); |
123 | |
124 | /** |
125 | Modify a post on server. |
126 | |
127 | @param post is used to send the modified post including the |
128 | correct postId from it to the server. |
129 | */ |
130 | void modifyPost( KBlog::BlogPost *post ); |
131 | |
132 | void removePost( KBlog::BlogPost *post ); |
133 | /** |
134 | Set the Url of the server. |
135 | |
136 | @param server is the server url. |
137 | */ |
138 | void setUrl( const KUrl &server ); |
139 | |
140 | QString serverMessage() const; |
141 | |
142 | QString userId() const; |
143 | |
144 | Q_SIGNALS: |
145 | void addedFriend(); |
146 | void assignedFriendToCategory(); |
147 | void deletedFriend(); |
148 | void expiredCookie(); |
149 | void expiredAllCookies(); |
150 | void generatedCookie( const QString &cookie ); |
151 | void listedCategories( const QMap<QString, QString> &categories ); |
152 | void listedFriends( const QMap<QString, QMap<QString, QString> > &friends ); |
153 | void listedFriendsOf( const QMap<QString, |
154 | QMap<QString, QString> > &friendsOf ); |
155 | void listedMoods( const QMap<int, QString> &moods ); |
156 | void listedPictureKeywords( const QMap<QString, KUrl> &pictureKeywords ); |
157 | void fetchedUserInfo(); |
158 | |
159 | protected: |
160 | LiveJournal( const KUrl &server, LiveJournalPrivate &dd, QObject *parent = 0 ); |
161 | |
162 | private: |
163 | Q_DECLARE_PRIVATE( LiveJournal ) |
164 | Q_PRIVATE_SLOT( d_func(), |
165 | void slotAddFriend( const QList<QVariant> &, const QVariant & ) ) |
166 | Q_PRIVATE_SLOT( d_func(), |
167 | void slotAssignFriendToCategory( const QList<QVariant> &, const QVariant & ) ) |
168 | Q_PRIVATE_SLOT( d_func(), |
169 | void slotCreatePost( const QList<QVariant> &, const QVariant & ) ) |
170 | Q_PRIVATE_SLOT( d_func(), |
171 | void slotDeleteFriend( const QList<QVariant> &, const QVariant & ) ) |
172 | // Q_PRIVATE_SLOT( d_func(), |
173 | // void slotExpireCookie( const QList<QVariant> &, const QVariant & ) ) |
174 | Q_PRIVATE_SLOT( d_func(), |
175 | void slotFetchPost( const QList<QVariant> &, const QVariant & ) ) |
176 | Q_PRIVATE_SLOT( d_func(), |
177 | void slotFetchUserInfo( const QList<QVariant> &, const QVariant & ) ) |
178 | // Q_PRIVATE_SLOT( d_func(), |
179 | // void slotGenerateCookie( const QList<QVariant> &, const QVariant & ) ) |
180 | Q_PRIVATE_SLOT( d_func(), |
181 | void slotListCategories( const QList<QVariant> &, const QVariant & ) ) |
182 | Q_PRIVATE_SLOT( d_func(), |
183 | void slotListFriends( const QList<QVariant> &, const QVariant & ) ) |
184 | Q_PRIVATE_SLOT( d_func(), |
185 | void slotListFriendsOf( const QList<QVariant> &, const QVariant & ) ) |
186 | Q_PRIVATE_SLOT( d_func(), |
187 | void slotListMoods( const QList<QVariant> &, const QVariant & ) ) |
188 | Q_PRIVATE_SLOT( d_func(), |
189 | void slotListPictureKeywords( const QList<QVariant> &, const QVariant & ) ) |
190 | Q_PRIVATE_SLOT( d_func(), |
191 | void slotListRecentPosts( const QList<QVariant> &, const QVariant & ) ) |
192 | Q_PRIVATE_SLOT( d_func(), |
193 | void slotModifyPost( const QList<QVariant> &, const QVariant & ) ) |
194 | Q_PRIVATE_SLOT( d_func(), |
195 | void slotRemovePost( const QList<QVariant> &, const QVariant & ) ) |
196 | Q_PRIVATE_SLOT( d_func(), |
197 | void slotError( int, const QString &, const QVariant & ) ) |
198 | }; |
199 | // Q_DECLARE_OPERATORS_FOR_FLAGS( LiveJournal::GenerateCookieOptions ) |
200 | |
201 | } //namespace KBlog |
202 | #endif |
203 |
Warning: That file was not part of the compilation database. It may have many parsing errors.