[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdepim/knotes
From: Michael Brade <brade () kde ! org>
Date: 2006-07-10 20:02:00
Message-ID: 1152561720.156532.16380.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 560626 by brade:
Add 4 new DCOP functions to get and change a note's geometry:
width(), height(), move(), resize()
Ok'ed by Cornelius.
M +30 -0 KNotesAppIface.h
M +36 -0 knotesapp.cpp
M +6 -0 knotesapp.h
--- branches/KDE/3.5/kdepim/knotes/KNotesAppIface.h #560625:560626
@@ -158,6 +158,36 @@
virtual ASYNC hideAllNotes() const = 0;
/**
+ * Returns the width of a note.
+ * @param noteId the id of the note in question
+ * @return the width as a uint
+ */
+ virtual int width( const QString& noteId ) const = 0;
+
+ /**
+ * Returns the height of a note.
+ * @param noteId the id of the note in question
+ * @return the height as a uint
+ */
+ virtual int height( const QString& noteId ) const = 0;
+
+ /**
+ * Repositions a note.
+ * @param noteId the id of the note to be moved
+ * @param x the new x-coordinate of the note
+ * @param y the new y-coordinate of the note
+ */
+ virtual ASYNC move( const QString& noteId, int x, int y ) const = 0;
+
+ /**
+ * Changes the size of a note.
+ * @param noteId the id of the note to be resized
+ * @param width the new width of the note
+ * @param height the new height of the note
+ */
+ virtual ASYNC resize( const QString& noteId, int width, int height ) const = 0;
+
+ /**
* This tells KNotes that a specific app has synchronized with all the notes.
* @param app the app that has synced with KNotes
*/
--- branches/KDE/3.5/kdepim/knotes/knotesapp.cpp #560625:560626
@@ -382,6 +382,42 @@
kdWarning(5500) << "setColor: no note with id: " << id << endl;
}
+int KNotesApp::width( const QString& id ) const
+{
+ KNote* note = m_noteList[id];
+ if ( note )
+ return note->width();
+ else
+ return 0;
+}
+
+int KNotesApp::height( const QString& id ) const
+{
+ KNote* note = m_noteList[id];
+ if ( note )
+ return note->height();
+ else
+ return 0;
+}
+
+void KNotesApp::move( const QString& id, int x, int y ) const
+{
+ KNote* note = m_noteList[id];
+ if ( note )
+ return note->move( x, y );
+ else
+ kdWarning(5500) << "move: no note with id: " << id << endl;
+}
+
+void KNotesApp::resize( const QString& id, int width, int height ) const
+{
+ KNote* note = m_noteList[id];
+ if ( note )
+ return note->resize( width, height );
+ else
+ kdWarning(5500) << "resize: no note with id: " << id << endl;
+}
+
void KNotesApp::sync( const QString& app )
{
QDictIterator<KNote> it( m_noteList );
--- branches/KDE/3.5/kdepim/knotes/knotesapp.h #560625:560626
@@ -80,6 +80,12 @@
QMap<QString,QString> notes() const;
+ int width( const QString& noteId ) const;
+ int height( const QString& noteId ) const;
+
+ void move( const QString& noteId, int x, int y ) const;
+ void resize( const QString& noteId, int width, int height ) const;
+
void sync( const QString& app );
bool isNew( const QString& app, const QString& id ) const;
bool isModified( const QString& app, const QString& id ) const;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic