Commit 96940659 authored by Fredy Yanardi's avatar Fredy Yanardi

Make kopageapp supports inline objects, put insert variables into kpresenter's menu

svn path=/trunk/koffice/; revision=714115
parent 1432f48b
......@@ -30,6 +30,7 @@
#include <KoOasisLoadingContext.h>
#include <KoShapeManager.h>
#include <KoShapeLayer.h>
#include <KoInlineTextObjectManager.h>
#include <KoShapeStyleWriter.h>
#include <KoPathShape.h>
#include <KoLineBorder.h>
......@@ -65,6 +66,7 @@ KoPADocument::KoPADocument( QWidget* parentWidget, QObject* parent, bool singleV
insertPage( new KoPAPage( masterPage ), 1 );
insertPage( new KoPAPage( masterPage ), 2 );*/
#endif
m_inlineTextObjectManager = new KoInlineTextObjectManager(this);
}
KoPADocument::~KoPADocument()
......
......@@ -32,6 +32,8 @@ class KoPAPage;
class KoPAPageBase;
class KoPAMasterPage;
class KoInlineTextObjectManager;
/// Document class that stores KoPAPage and KoPAMasterPage objects
class KOPAGEAPP_EXPORT KoPADocument : public KoDocument, public KoShapeControllerBase
{
......@@ -120,6 +122,8 @@ public:
*/
virtual KoPAMasterPage * newMasterPage();
/// return the inlineTextObjectManager for this document.
KoInlineTextObjectManager *inlineTextObjectManager() const { return m_inlineTextObjectManager; }
protected:
virtual KoView *createViewInstance( QWidget *parent ) = 0;
......@@ -165,6 +169,7 @@ protected:
private:
QList<KoPAPageBase*> m_pages;
QList<KoPAPageBase*> m_masterPages;
KoInlineTextObjectManager *m_inlineTextObjectManager;
};
#endif /* KOPADOCUMENT_H */
......@@ -35,6 +35,7 @@
#include <KoZoomAction.h>
#include <KoZoomController.h>
#include <KoTextSelectionHandler.h>
#include <KoInlineTextObjectManager.h>
#include <KoSelection.h>
#include <KoToolDockerFactory.h>
#include <KoToolDocker.h>
......@@ -52,6 +53,7 @@
#include <klocale.h>
#include <kicon.h>
#include <ktoggleaction.h>
#include <kactionmenu.h>
#include <kactioncollection.h>
#include <kstatusbar.h>
......@@ -177,6 +179,11 @@ void KoPAView::initActions()
m_actionDeletePage->setToolTip( i18n( "Delete a new page after the current one" ) );
m_actionDeletePage->setWhatsThis( i18n( "Delete a new page after the current one" ) );
connect( m_actionDeletePage, SIGNAL( triggered() ), this, SLOT( deletePage() ) );
KActionMenu *actionMenu = new KActionMenu(i18n("Variable"), this);
foreach(QAction *action, m_doc->inlineTextObjectManager()->createInsertVariableActions(m_canvas))
actionMenu->addAction(action);
actionCollection()->addAction("insert_variable", actionMenu);
}
void KoPAView::viewSnapToGrid()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment