Changeset View
Changeset View
Standalone View
Standalone View
src/attachmenthandler.h
Show All 20 Lines | 19 | /** | |||
---|---|---|---|---|---|
21 | This file is part of the API for handling calendar data and provides | 21 | This file is part of the API for handling calendar data and provides | ||
22 | static functions for dealing with calendar incidence attachments. | 22 | static functions for dealing with calendar incidence attachments. | ||
23 | 23 | | |||
24 | @author Allen Winter \<winter@kde.org\> | 24 | @author Allen Winter \<winter@kde.org\> | ||
25 | */ | 25 | */ | ||
26 | #ifndef CALENDARSUPPORT_ATTACHMENTHANDLER_H | 26 | #ifndef CALENDARSUPPORT_ATTACHMENTHANDLER_H | ||
27 | #define CALENDARSUPPORT_ATTACHMENTHANDLER_H | 27 | #define CALENDARSUPPORT_ATTACHMENTHANDLER_H | ||
28 | 28 | | |||
29 | #include <KCalCore/Attachment> | 29 | #include <KCalendarCore/Attachment> | ||
30 | #include <KCalCore/Incidence> | 30 | #include <KCalendarCore/Incidence> | ||
31 | #include <KCalCore/ScheduleMessage> | 31 | #include <KCalendarCore/ScheduleMessage> | ||
32 | 32 | | |||
33 | #include <QObject> | 33 | #include <QObject> | ||
34 | 34 | | |||
35 | class KJob; | 35 | class KJob; | ||
36 | 36 | | |||
37 | class QWidget; | 37 | class QWidget; | ||
38 | 38 | | |||
39 | namespace CalendarSupport { | 39 | namespace CalendarSupport { | ||
Show All 17 Lines | 49 | public: | |||
57 | 57 | | |||
58 | /** | 58 | /** | ||
59 | * Finds the attachment in the user's calendar, by @p attachmentName and @p incidence. | 59 | * Finds the attachment in the user's calendar, by @p attachmentName and @p incidence. | ||
60 | * | 60 | * | ||
61 | * @param attachmentName is the name of the attachment | 61 | * @param attachmentName is the name of the attachment | ||
62 | * @param incidence is a pointer to a valid Incidence object containing the attachment. | 62 | * @param incidence is a pointer to a valid Incidence object containing the attachment. | ||
63 | * @return a pointer to the Attachment object located; 0 if no such attachment could be found. | 63 | * @return a pointer to the Attachment object located; 0 if no such attachment could be found. | ||
64 | */ | 64 | */ | ||
65 | KCalCore::Attachment find(const QString &attachmentName, | 65 | KCalendarCore::Attachment find(const QString &attachmentName, | ||
66 | const KCalCore::Incidence::Ptr &incidence); | 66 | const KCalendarCore::Incidence::Ptr &incidence); | ||
67 | 67 | | |||
68 | /** | 68 | /** | ||
69 | * Finds the attachment in the user's calendar, by @p attachmentName and a scheduler message; | 69 | * Finds the attachment in the user's calendar, by @p attachmentName and a scheduler message; | ||
70 | * in other words, this function is intended to retrieve attachments from calendar invitations. | 70 | * in other words, this function is intended to retrieve attachments from calendar invitations. | ||
71 | * | 71 | * | ||
72 | * @param attachmentName is the name of the attachment | 72 | * @param attachmentName is the name of the attachment | ||
73 | * @param message is a pointer to a valid ScheduleMessage object containing the attachment. | 73 | * @param message is a pointer to a valid ScheduleMessage object containing the attachment. | ||
74 | * @return a pointer to the Attachment object located; 0 if no such attachment could be found. | 74 | * @return a pointer to the Attachment object located; 0 if no such attachment could be found. | ||
75 | */ | 75 | */ | ||
76 | KCalCore::Attachment find(const QString &attachmentName, | 76 | KCalendarCore::Attachment find(const QString &attachmentName, | ||
77 | const KCalCore::ScheduleMessage::Ptr &message); | 77 | const KCalendarCore::ScheduleMessage::Ptr &message); | ||
78 | 78 | | |||
79 | /** | 79 | /** | ||
80 | * Launches a viewer on the specified attachment. | 80 | * Launches a viewer on the specified attachment. | ||
81 | * | 81 | * | ||
82 | * @param attachment is a pointer to a valid Attachment object. | 82 | * @param attachment is a pointer to a valid Attachment object. | ||
83 | * @return true if the viewer program successfully launched; false otherwise. | 83 | * @return true if the viewer program successfully launched; false otherwise. | ||
84 | */ | 84 | */ | ||
85 | bool view(const KCalCore::Attachment &attachment); | 85 | bool view(const KCalendarCore::Attachment &attachment); | ||
86 | 86 | | |||
87 | /** | 87 | /** | ||
88 | * Launches a viewer on the specified attachment. | 88 | * Launches a viewer on the specified attachment. | ||
89 | * | 89 | * | ||
90 | * @param attachmentName is the name of the attachment | 90 | * @param attachmentName is the name of the attachment | ||
91 | * @param incidence is a pointer to a valid Incidence object containing the attachment. | 91 | * @param incidence is a pointer to a valid Incidence object containing the attachment. | ||
92 | * @return true if the attachment could be found and the viewer program successfully launched; | 92 | * @return true if the attachment could be found and the viewer program successfully launched; | ||
93 | * false otherwise. | 93 | * false otherwise. | ||
94 | */ | 94 | */ | ||
95 | bool view(const QString &attachmentName, const KCalCore::Incidence::Ptr &incidence); | 95 | bool view(const QString &attachmentName, const KCalendarCore::Incidence::Ptr &incidence); | ||
96 | 96 | | |||
97 | /** | 97 | /** | ||
98 | Launches a viewer on the specified attachment. | 98 | Launches a viewer on the specified attachment. | ||
99 | 99 | | |||
100 | @param attachmentName is the name of the attachment | 100 | @param attachmentName is the name of the attachment | ||
101 | @param uid is a QString containing a UID of the incidence containing the attachment. | 101 | @param uid is a QString containing a UID of the incidence containing the attachment. | ||
102 | 102 | | |||
103 | This function is async and will return immediately. Listen to signal viewFinished() | 103 | This function is async and will return immediately. Listen to signal viewFinished() | ||
104 | if you're interested on the success of this operation. | 104 | if you're interested on the success of this operation. | ||
105 | 105 | | |||
106 | */ | 106 | */ | ||
107 | void view(const QString &attachmentName, const QString &uid); | 107 | void view(const QString &attachmentName, const QString &uid); | ||
108 | 108 | | |||
109 | /** | 109 | /** | ||
110 | Launches a viewer on the specified attachment. | 110 | Launches a viewer on the specified attachment. | ||
111 | 111 | | |||
112 | @param attachmentName is the name of the attachment | 112 | @param attachmentName is the name of the attachment | ||
113 | @param message is a pointer to a valid ScheduleMessage object containing the attachment. | 113 | @param message is a pointer to a valid ScheduleMessage object containing the attachment. | ||
114 | 114 | | |||
115 | @return true if the attachment could be found and the viewer program successfully launched; | 115 | @return true if the attachment could be found and the viewer program successfully launched; | ||
116 | false otherwise. | 116 | false otherwise. | ||
117 | */ | 117 | */ | ||
118 | bool view(const QString &attachmentName, const KCalCore::ScheduleMessage::Ptr &message); | 118 | bool view(const QString &attachmentName, const KCalendarCore::ScheduleMessage::Ptr &message); | ||
119 | 119 | | |||
120 | /** | 120 | /** | ||
121 | Saves the specified attachment to a file of the user's choice. | 121 | Saves the specified attachment to a file of the user's choice. | ||
122 | 122 | | |||
123 | @param attachment is a pointer to a valid Attachment object. | 123 | @param attachment is a pointer to a valid Attachment object. | ||
124 | 124 | | |||
125 | @return true if the save operation was successful; false otherwise. | 125 | @return true if the save operation was successful; false otherwise. | ||
126 | */ | 126 | */ | ||
127 | bool saveAs(const KCalCore::Attachment &attachment); | 127 | bool saveAs(const KCalendarCore::Attachment &attachment); | ||
128 | 128 | | |||
129 | /** | 129 | /** | ||
130 | Saves the specified attachment to a file of the user's choice. | 130 | Saves the specified attachment to a file of the user's choice. | ||
131 | 131 | | |||
132 | @param attachmentName is the name of the attachment | 132 | @param attachmentName is the name of the attachment | ||
133 | @param incidence is a pointer to a valid Incidence object containing the attachment. | 133 | @param incidence is a pointer to a valid Incidence object containing the attachment. | ||
134 | 134 | | |||
135 | @return true if the attachment could be found and the save operation was successful; | 135 | @return true if the attachment could be found and the save operation was successful; | ||
136 | false otherwise. | 136 | false otherwise. | ||
137 | */ | 137 | */ | ||
138 | bool saveAs(const QString &attachmentName, const KCalCore::Incidence::Ptr &incidence); | 138 | bool saveAs(const QString &attachmentName, const KCalendarCore::Incidence::Ptr &incidence); | ||
139 | 139 | | |||
140 | /** | 140 | /** | ||
141 | Saves the specified attachment to a file of the user's choice. | 141 | Saves the specified attachment to a file of the user's choice. | ||
142 | 142 | | |||
143 | @param attachmentName is the name of the attachment | 143 | @param attachmentName is the name of the attachment | ||
144 | @param uid is a QString containing a UID of the incidence containing the attachment. | 144 | @param uid is a QString containing a UID of the incidence containing the attachment. | ||
145 | 145 | | |||
146 | This function is async, it will return immediately. Listen to signal saveAsFinished() | 146 | This function is async, it will return immediately. Listen to signal saveAsFinished() | ||
147 | if you're interested on the success of this operation. | 147 | if you're interested on the success of this operation. | ||
148 | */ | 148 | */ | ||
149 | void saveAs(const QString &attachmentName, const QString &uid); | 149 | void saveAs(const QString &attachmentName, const QString &uid); | ||
150 | 150 | | |||
151 | /** | 151 | /** | ||
152 | Saves the specified attachment to a file of the user's choice. | 152 | Saves the specified attachment to a file of the user's choice. | ||
153 | 153 | | |||
154 | @param attachmentName is the name of the attachment | 154 | @param attachmentName is the name of the attachment | ||
155 | @param message is a pointer to a valid ScheduleMessage object containing the attachment. | 155 | @param message is a pointer to a valid ScheduleMessage object containing the attachment. | ||
156 | 156 | | |||
157 | @return true if the attachment could be found and the save operation was successful; | 157 | @return true if the attachment could be found and the save operation was successful; | ||
158 | false otherwise. | 158 | false otherwise. | ||
159 | */ | 159 | */ | ||
160 | bool saveAs(const QString &attachmentName, const KCalCore::ScheduleMessage::Ptr &message); | 160 | bool saveAs(const QString &attachmentName, const KCalendarCore::ScheduleMessage::Ptr &message); | ||
161 | 161 | | |||
162 | Q_SIGNALS: | 162 | Q_SIGNALS: | ||
163 | void viewFinished(const QString &uid, const QString &attachmentName, bool success); | 163 | void viewFinished(const QString &uid, const QString &attachmentName, bool success); | ||
164 | void saveAsFinished(const QString &uid, const QString &attachmentName, bool success); | 164 | void saveAsFinished(const QString &uid, const QString &attachmentName, bool success); | ||
165 | 165 | | |||
166 | private: | 166 | private: | ||
167 | void slotFinishView(KJob *job); | 167 | void slotFinishView(KJob *job); | ||
168 | void slotFinishSaveAs(KJob *job); | 168 | void slotFinishSaveAs(KJob *job); | ||
169 | //@cond PRIVATE | 169 | //@cond PRIVATE | ||
170 | class Private; | 170 | class Private; | ||
171 | Private *const d; | 171 | Private *const d; | ||
172 | //@endcond | 172 | //@endcond | ||
173 | }; // class AttachmentHandler | 173 | }; // class AttachmentHandler | ||
174 | } // namespace CalendarSupport | 174 | } // namespace CalendarSupport | ||
175 | 175 | | |||
176 | #endif | 176 | #endif |