TDE personal information management applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

223 lines
7.4 KiB

  1. /*******************************************************************
  2. KNotesIface.h -- This file defines the DCOP interface for KNotes.
  3. Copyright (C) 2004 by Michael Brade <brade@kde.org>
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  15. In addition, as a special exception, the copyright holders give
  16. permission to link the code of this program with any edition of
  17. the TQt library by Trolltech AS, Norway (or with modified versions
  18. of TQt that use the same license as TQt), and distribute linked
  19. combinations including the two. You must obey the GNU General
  20. Public License in all respects for all of the code used other than
  21. TQt. If you modify this file, you may extend this exception to
  22. your version of the file, but you are not obligated to do so. If
  23. you do not wish to do so, delete this exception statement from
  24. your version.
  25. *******************************************************************/
  26. #ifndef __KNotesAppIface_h__
  27. #define __KNotesAppIface_h__
  28. #include <tqstring.h>
  29. #include <tqmap.h>
  30. #include <tqdatetime.h>
  31. #include <dcopobject.h>
  32. class KNotesAppIface : virtual public DCOPObject
  33. {
  34. K_DCOP
  35. k_dcop:
  36. /**
  37. * Create a new note.
  38. * @param name the name (title) of the new note, if it is empty,
  39. * KNotes will choose an appropriate name
  40. * @param text the body of the new note
  41. * @return the new notes' id
  42. */
  43. virtual TQString newNote( const TQString& name = TQString(),
  44. const TQString& text = TQString() ) = 0;
  45. /**
  46. * Create a new note and inserts the current text in the clipboard
  47. * as text.
  48. *
  49. * @param name the name (title) of the new note, if it is empty,
  50. * KNotes will choose an appropriate name
  51. * @return the new notes' id
  52. */
  53. virtual TQString newNoteFromClipboard( const TQString& name = TQString() ) = 0;
  54. /**
  55. * Deletes a note forever.
  56. * @param noteId the id of the note to kill
  57. */
  58. virtual ASYNC killNote( const TQString& noteId ) = 0;
  59. /**
  60. * Deletes a note forever.
  61. * @param noteId the id of the note to kill
  62. * @param force do not request confirmation
  63. */
  64. virtual ASYNC killNote( const TQString& noteId, bool force ) = 0;
  65. /**
  66. * Get all the notes including their ids.
  67. * @return a TQMap that maps the id of a note to its name
  68. */
  69. virtual TQMap<TQString,TQString> notes() const = 0;
  70. /**
  71. * Changes the title/name of a note.
  72. * @param noteId the id of the note to be modified
  73. * @param newName the new title
  74. */
  75. virtual ASYNC setName( const TQString& noteId, const TQString& newName ) = 0;
  76. /**
  77. * Sets the text of a note. This will delete the old text!
  78. * @param noteId the id of the note
  79. * @param newText the new text for the note
  80. */
  81. virtual ASYNC setText( const TQString& noteId, const TQString& newText ) = 0;
  82. /**
  83. * Returns the foreground/text color of a note.
  84. * @param noteId the id of the note in question
  85. * @return the foreground/text color as a TQString
  86. */
  87. virtual TQString fgColor( const TQString& noteId ) const = 0;
  88. /**
  89. * Returns the background color of a note.
  90. * @param noteId the id of the note in question
  91. * @return the background color as a TQString
  92. */
  93. virtual TQString bgColor( const TQString& noteId ) const = 0;
  94. /**
  95. * Sets the color (foreground and background color) of a note.
  96. * @param noteId the id of the note
  97. * @param fgColor the new text color for the note
  98. * @param bgColor the new background color for the note
  99. */
  100. virtual ASYNC setColor( const TQString& noteId, const TQString& fgColor,
  101. const TQString& bgColor ) = 0;
  102. /**
  103. * Returns the title/name of a note.
  104. * @param noteId the id of the note in question
  105. * @return the name as a TQString
  106. */
  107. virtual TQString name( const TQString& noteId ) const = 0;
  108. /**
  109. * Returns the text of a note.
  110. * @param noteId the id of the note in question
  111. * @return the body as a TQString
  112. */
  113. virtual TQString text( const TQString& noteId ) const = 0;
  114. /******** HERE STARTS THE KNotesAppIface DCOP INTERFACE EXTENSION ********/
  115. /**
  116. * Show a note as if it had been selected from the "notes" menu.
  117. * @param noteId the id of the note to show
  118. */
  119. virtual ASYNC showNote( const TQString& noteId ) const = 0;
  120. /**
  121. * Hide a note.
  122. * @param noteId the id of the note to hide
  123. */
  124. virtual ASYNC hideNote( const TQString& noteId ) const = 0;
  125. /**
  126. * Show all notes on their respective desktops.
  127. */
  128. virtual ASYNC showAllNotes() const = 0;
  129. /**
  130. * Hide all notes.
  131. */
  132. virtual ASYNC hideAllNotes() const = 0;
  133. /**
  134. * Returns the width of a note.
  135. * @param noteId the id of the note in question
  136. * @return the width as a uint
  137. */
  138. virtual int width( const TQString& noteId ) const = 0;
  139. /**
  140. * Returns the height of a note.
  141. * @param noteId the id of the note in question
  142. * @return the height as a uint
  143. */
  144. virtual int height( const TQString& noteId ) const = 0;
  145. /**
  146. * Repositions a note.
  147. * @param noteId the id of the note to be moved
  148. * @param x the new x-coordinate of the note
  149. * @param y the new y-coordinate of the note
  150. */
  151. virtual ASYNC move( const TQString& noteId, int x, int y ) const = 0;
  152. /**
  153. * Changes the size of a note.
  154. * @param noteId the id of the note to be resized
  155. * @param width the new width of the note
  156. * @param height the new height of the note
  157. */
  158. virtual ASYNC resize( const TQString& noteId, int width, int height ) const = 0;
  159. /**
  160. * This tells KNotes that a specific app has synchronized with all the notes.
  161. * @param app the app that has synced with KNotes
  162. */
  163. virtual ASYNC sync( const TQString& app ) = 0;
  164. /**
  165. * Test if a note was created new after the last sync.
  166. * @param app the app that wants to get the status since the last sync
  167. * @param noteId the id of the note
  168. * @return true if the note is new, false if not or if the note does
  169. * not exist
  170. */
  171. virtual bool isNew( const TQString& app, const TQString& noteId ) const = 0;
  172. /**
  173. * Test if a note was modified since the last sync.
  174. * @param app the app that wants to get the status since the last sync
  175. * @param noteId the id of the note
  176. * @return true if modified (note that this will return true if the note is
  177. * new as well!) and false if the note is not modified or doesn't exist
  178. */
  179. virtual bool isModified( const TQString& app, const TQString& noteId ) const = 0;
  180. /**
  181. * Get the last modified time of a note
  182. * @return the last modified time as a TQDateTime
  183. */
  184. virtual TQDateTime getLastModified( const TQString& noteId ) const = 0;
  185. };
  186. #endif