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.
 
 
 
 
 
 

111 lines
3.5 KiB

  1. /*******************************************************************
  2. KNotesIface.h -- This file defines the DCOP interface for KNotes.
  3. Copyright (C) 2000 by Adriaan de Groot
  4. 2001-2004 by Michael Brade <brade@kde.org>
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. *******************************************************************/
  17. #ifndef __KNotesIface_h__
  18. #define __KNotesIface_h__
  19. #include <tqstring.h>
  20. #include <tqmap.h>
  21. #include <tqdatetime.h>
  22. #include <dcopobject.h>
  23. class KNotesIface : virtual public DCOPObject
  24. {
  25. K_DCOP
  26. k_dcop:
  27. /**
  28. * Create a new note.
  29. * @param name the name (title) of the new note, if it is empty,
  30. * KNotes will choose an appropriate name
  31. * @param text the body of the new note
  32. * @return the new notes' id
  33. */
  34. virtual TQString newNote( const TQString& name = TQString(),
  35. const TQString& text = TQString() ) = 0;
  36. /**
  37. * Create a new note and inserts the current text in the clipboard
  38. * as text.
  39. *
  40. * @param name the name (title) of the new note, if it is empty,
  41. * KNotes will choose an appropriate name
  42. * @return the new notes' id
  43. */
  44. virtual TQString newNoteFromClipboard( const TQString& name = TQString() ) = 0;
  45. /**
  46. * Deletes a note forever.
  47. * @param noteId the id of the note to kill
  48. */
  49. virtual ASYNC killNote( const TQString& noteId ) = 0;
  50. /**
  51. * Deletes a note forever.
  52. * @param noteId the id of the note to kill
  53. * @param force do not request confirmation
  54. */
  55. virtual ASYNC killNote( const TQString& noteId, bool force ) = 0;
  56. /**
  57. * Get all the notes including their ids.
  58. * @return a TQMap that maps the id of a note to its name
  59. */
  60. virtual TQMap<TQString,TQString> notes() const = 0;
  61. /**
  62. * Changes the title/name of a note.
  63. * @param noteId the id of the note to be modified
  64. * @param newName the new title
  65. */
  66. virtual ASYNC setName( const TQString& noteId, const TQString& newName ) = 0;
  67. /**
  68. * Sets the text of a note. This will delete the old text!
  69. * @param noteId the id of the note
  70. * @param newText the new text for the note
  71. */
  72. virtual ASYNC setText( const TQString& noteId, const TQString& newText ) = 0;
  73. /**
  74. * Returns the title/name of a note.
  75. * @param noteId the id of the note in question
  76. * @return the name as a TQString
  77. */
  78. virtual TQString name( const TQString& noteId ) const = 0;
  79. /**
  80. * Returns the text of a note.
  81. * @param noteId the id of the note in question
  82. * @return the body as a TQString
  83. */
  84. virtual TQString text( const TQString& noteId ) const = 0;
  85. /**
  86. * Get the last modified time of a note
  87. * @return the last modified time as a TQDateTime
  88. */
  89. virtual TQDateTime getLastModified( const TQString& noteId ) const = 0;
  90. };
  91. #endif