[Libreoffice-commits] core.git: Branch 'feature/slidehack' - 2 commits - sd/inc sd/Library_sdui.mk sd/source sd/uiconfig sd/UI_simpress.mk
Michael Meeks
michael.meeks at suse.com
Wed Apr 10 09:37:36 PDT 2013
sd/Library_sdui.mk | 1
sd/UI_simpress.mk | 1
sd/inc/sdabstdlg.hxx | 3
sd/inc/sdpage.hxx | 9
sd/inc/slidehack.hxx | 45 +
sd/source/ui/dlg/GroupSlidesDialog.cxx | 61 ++
sd/source/ui/dlg/GroupSlidesDialog.hxx | 52 ++
sd/source/ui/dlg/sddlgfact.cxx | 8
sd/source/ui/dlg/sddlgfact.hxx | 5
sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 42 +
sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx | 5
sd/uiconfig/simpress/ui/groupslides.ui | 306 +++++++++++++
12 files changed, 527 insertions(+), 11 deletions(-)
New commits:
commit 5dfe4ff3adff1193965572522d630f334e730129
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Apr 10 17:25:32 2013 +0100
start of slide grouping UI in the slide-sorter.
Change-Id: If19ee509b698cb69e8e7313837a4a5428f8b3d1d
diff --git a/sd/Library_sdui.mk b/sd/Library_sdui.mk
index 14f4fbb..af2ba07 100644
--- a/sd/Library_sdui.mk
+++ b/sd/Library_sdui.mk
@@ -106,6 +106,7 @@ $(eval $(call gb_Library_add_exception_objects,sdui,\
sd/source/ui/dlg/tpoption \
sd/source/ui/dlg/vectdlg \
sd/source/ui/dlg/PhotoAlbumDialog \
+ sd/source/ui/dlg/GroupSlidesDialog \
))
# $(WORKDIR)/inc/sd/sddll0.hxx :
diff --git a/sd/UI_simpress.mk b/sd/UI_simpress.mk
index d6cf6e0..513f292 100644
--- a/sd/UI_simpress.mk
+++ b/sd/UI_simpress.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_UI_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/presentationdialog \
sd/uiconfig/simpress/ui/printeroptions \
sd/uiconfig/simpress/ui/photoalbum \
+ sd/uiconfig/simpress/ui/groupslides \
))
# vim: set noet sw=4 ts=4:
diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx
index 21c78b7..a42a481 100644
--- a/sd/inc/sdabstdlg.hxx
+++ b/sd/inc/sdabstdlg.hxx
@@ -213,7 +213,8 @@ public:
virtual CreateTabPage GetSdOptionsMiscTabPageCreatorFunc() = 0;
virtual CreateTabPage GetSdOptionsSnapTabPageCreatorFunc() = 0;
- virtual VclAbstractDialog* CreateSdPhotoAlbumDialog( ::Window* pWindow, SdDrawDocument* pDoc) = 0;
+ virtual VclAbstractDialog* CreateSdPhotoAlbumDialog( ::Window* pWindow, SdDrawDocument* pDoc) = 0;
+ virtual VclAbstractDialog* CreateSdGroupDialog( ::Window* pWindow, SdDrawDocument *pDoc, const std::vector< SdPage * > &rPagesToGroup ) = 0;
protected:
~SdAbstractDialogFactory() {}
diff --git a/sd/source/ui/dlg/GroupSlidesDialog.cxx b/sd/source/ui/dlg/GroupSlidesDialog.cxx
new file mode 100644
index 0000000..d6c3cb2
--- /dev/null
+++ b/sd/source/ui/dlg/GroupSlidesDialog.cxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#include "GroupSlidesDialog.hxx"
+
+#include <com/sun/star/graphic/GraphicProvider.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/componentcontext.hxx>
+
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
+#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
+
+#include <sfx2/filedlghelper.hxx>
+#include <tools/urlobj.hxx>
+
+#include <unotools/pathoptions.hxx>
+#include <unotools/useroptions.hxx>
+#include <unotools/ucbstreamhelper.hxx>
+
+#include <vcl/msgbox.hxx>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::presentation;
+
+namespace sd
+{
+
+SdGroupSlidesDialog::SdGroupSlidesDialog(Window* pWindow, SdDrawDocument* pActDoc,
+ const std::vector< SdPage * > &rPages )
+ : ModalDialog(pWindow, "GroupSlidesDialog", "modules/simpress/ui/groupslides.ui"),
+ pDoc(pActDoc),
+ maPages( rPages )
+{
+ get(pCancelBtn, "cancel_btn");
+ pCancelBtn->SetClickHdl(LINK(this, SdGroupSlidesDialog, CancelHdl));
+}
+
+SdGroupSlidesDialog::~SdGroupSlidesDialog()
+{
+}
+
+IMPL_LINK_NOARG(SdGroupSlidesDialog, CancelHdl)
+{
+ EndDialog(0);
+ return 0;
+}
+
+}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/GroupSlidesDialog.hxx b/sd/source/ui/dlg/GroupSlidesDialog.hxx
new file mode 100644
index 0000000..ed5c9c8
--- /dev/null
+++ b/sd/source/ui/dlg/GroupSlidesDialog.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#ifndef _SD_GROUPSLIDESDIALOG_HXX
+#define _SD_GROUPSLIDESDIALOG_HXX
+
+#include "tools/link.hxx"
+#include "sdpage.hxx"
+#include "pres.hxx"
+#include "drawdoc.hxx"
+
+#include <vcl/lstbox.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/field.hxx>
+#include <vcl/graphicfilter.hxx>
+#include <svx/svdotext.hxx>
+
+class SdrTextObj;
+class SdDrawDocument;
+class SdPage;
+
+namespace sd
+{
+
+class SdGroupSlidesDialog : public ModalDialog
+{
+public:
+ SdGroupSlidesDialog(Window* pWindow, SdDrawDocument* pActDoc,
+ const std::vector< SdPage * > &rPages );
+ ~SdGroupSlidesDialog();
+
+private:
+ CancelButton* pCancelBtn;
+
+ SdDrawDocument* pDoc;
+ std::vector< SdPage * > maPages;
+
+ DECL_LINK(CancelHdl, void*);
+};
+
+}
+
+#endif // _SD_GROUPSLIDESDIALOG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index 0103a32..312de22 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -47,6 +47,7 @@
#include "masterlayoutdlg.hxx"
#include "headerfooterdlg.hxx"
#include "PhotoAlbumDialog.hxx"
+#include "GroupSlidesDialog.hxx"
IMPL_ABSTDLG_BASE(SdVclAbstractDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractCopyDlg_Impl);
@@ -576,7 +577,12 @@ AbstractHeaderFooterDialog* SdAbstractDialogFactory_Impl::CreateHeaderFooterDial
VclAbstractDialog * SdAbstractDialogFactory_Impl::CreateSdPhotoAlbumDialog( ::Window* pWindow, SdDrawDocument* pDoc )
{
- return new SdVclAbstractDialog_Impl( new ::sd::SdPhotoAlbumDialog( pWindow, pDoc ) );
+ return new SdVclAbstractDialog_Impl( new ::sd::SdPhotoAlbumDialog( pWindow, pDoc ) );
+}
+
+VclAbstractDialog* SdAbstractDialogFactory_Impl::CreateSdGroupDialog( ::Window* pWindow, SdDrawDocument *pDoc, const std::vector< SdPage * > &rPagesToGroup )
+{
+ return new SdVclAbstractDialog_Impl( new ::sd::SdGroupSlidesDialog( pWindow, pDoc, rPagesToGroup ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index bd44d54..337e4da 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -276,10 +276,9 @@ public:
virtual SfxAbstractDialog* CreatSdActionDialog( ::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView );
virtual AbstractSdVectorizeDlg* CreateSdVectorizeDlg( ::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell );
virtual AbstractSdPublishingDlg* CreateSdPublishingDlg( ::Window* pWindow, DocumentType eDocType);
-
virtual VclAbstractDialog* CreateSdPhotoAlbumDialog( ::Window* pWindow, SdDrawDocument* pDoc);
-
- virtual VclAbstractDialog* CreateMasterLayoutDialog( ::Window* pParent,
+ virtual VclAbstractDialog* CreateSdGroupDialog( ::Window* pWindow, SdDrawDocument *pDoc, const std::vector< SdPage * > &rPagesToGroup );
+ virtual VclAbstractDialog* CreateMasterLayoutDialog( ::Window* pParent,
SdDrawDocument* pDoc,
SdPage* ); // add for MasterLayoutDialog
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 0b6b060..a500dee 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -65,6 +65,7 @@
#include "glob.hrc"
#include "unmodpg.hxx"
#include "DrawViewShell.hxx"
+#include "sdabstdlg.hxx"
#include <sfx2/request.hxx>
#include <sfx2/viewfrm.hxx>
@@ -143,8 +144,11 @@ void SlotManager::FuTemporary (SfxRequest& rRequest)
break;
case SID_GROUP_SLIDES:
+ GroupSlides();
+ break;
+
case SID_UNGROUP_SLIDES:
- fprintf (stderr, "Execute group / un-group\n");
+ UnGroupSlides();
break;
case SID_PAGES_PER_ROW:
@@ -1266,6 +1270,42 @@ SlideExclusionState GetSlideExclusionState (model::PageEnumeration& rPageSet)
} // end of anonymous namespace
+void SlotManager::GroupSlides()
+{
+ PageKind ePageKind = mrSlideSorter.GetModel().GetPageType();
+ View* pDrView = &mrSlideSorter.GetView();
+
+ fprintf (stderr, "Execute -group\n");
+
+ model::PageEnumeration aSelectedPages (
+ model::PageEnumerationProvider::CreateSelectedPagesEnumeration(
+ mrSlideSorter.GetModel()));
+ std::vector< SdPage * > aPagesToGroup;
+ while (aSelectedPages.HasMoreElements())
+ {
+ SdPage* pPage = aSelectedPages.GetNextElement()->GetPage();
+ aPagesToGroup.push_back( pPage );
+ }
+ if( aPagesToGroup.size() > 0 )
+ {
+ SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
+ VclAbstractDialog *pDialog = pFact->CreateSdGroupDialog(
+ mrSlideSorter.GetContentWindow().get(), /* TESTME: window ? */
+ mrSlideSorter.GetModel().GetDocument(),
+ aPagesToGroup);
+ if ( pDialog->Execute() == RET_OK )
+ {
+// mrSlideSorter.Redraw(); // FIXME ...
+ }
+ delete pDialog;
+ }
+}
+
+void SlotManager::UnGroupSlides()
+{
+ fprintf (stderr, "Execute un-group\n");
+}
+
} } } // end of namespace ::sd::slidesorter::controller
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
index 5d76da6..b706d51 100644
--- a/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
+++ b/sd/source/ui/slidesorter/inc/controller/SlsSlotManager.hxx
@@ -105,6 +105,11 @@ private:
This can be the current selection or the insertion indicator.
*/
sal_Int32 GetInsertionPosition (void);
+
+ /// Handle SID_GROUP_SLIDES
+ void GroupSlides();
+ /// Handle SID_UNGROUP_SLIDES
+ void UnGroupSlides();
};
} } } // end of namespace ::sd::slidesorter::controller
diff --git a/sd/uiconfig/simpress/ui/groupslides.ui b/sd/uiconfig/simpress/ui/groupslides.ui
new file mode 100644
index 0000000..bb209bc
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/groupslides.ui
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="GroupSlidesDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Slide Grouping</property>
+ <property name="resizable">False</property>
+ <property name="window_position">center</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_resize_grip">False</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="create_btn">
+ <property name="label" translatable="yes">Add to group</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel_btn">
+ <property name="label">gtk-cancel</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Group:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Keywords</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText" id="comboboxtext1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Title</property>
+ <property name="justify">right</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">â</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="entry2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">â</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Select Group to add to:</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_spacing">12</property>
+ <child>
+ <object class="GtkRadioButton" id="rb_update_automatic">
+ <property name="label" translatable="yes">Automatic Update</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="rb_update_manual">
+ <property name="label" translatable="yes">Notify for Manual Update</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="rb_update_never">
+ <property name="label" translatable="yes">Never Update</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_action_appearance">False</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Select updating type:</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">create_btn</action-widget>
+ <action-widget response="0">cancel_btn</action-widget>
+ </action-widgets>
+ </object>
+</interface>
commit 21346ce5d21ee34b420159d9a737093b0a5cfe78
Author: Michael Meeks <michael.meeks at suse.com>
Date: Wed Apr 10 15:53:49 2013 +0100
tag each slide with it's origin.
Change-Id: I71e47cb5bbbbdbca8e70d846ff5e504c6edb01bd
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 0b5d631..1cfe4e8 100644
--- a/sd/inc/sdpage.hxx
+++ b/sd/inc/sdpage.hxx
@@ -98,6 +98,11 @@ namespace sd {
class UndoAttrObject;
}
+namespace SlideHack {
+ class OriginDetails;
+ typedef boost::shared_ptr< class OriginDetails > OriginDetailsPtr;
+}
+
class SD_DLLPUBLIC SdPage : public FmFormPage, public SdrObjUserCall
{
friend class SdGenericDrawPage;
@@ -381,8 +386,12 @@ public:
const sd::AnnotationVector& getAnnotations() const { return maAnnotations; }
bool hasAnnotations() const { return !maAnnotations.empty(); }
+ SlideHack::OriginDetailsPtr getOrigin() { return mpOrigin; }
+ void setOrigin(SlideHack::OriginDetailsPtr pOrigin) { mpOrigin = pOrigin; }
+
private:
bool mbIsPrecious;
+ SlideHack::OriginDetailsPtr mpOrigin;
/** clone the animations from this and set them to rTargetPage
*/
diff --git a/sd/inc/slidehack.hxx b/sd/inc/slidehack.hxx
index 822e160..6ff52b4 100644
--- a/sd/inc/slidehack.hxx
+++ b/sd/inc/slidehack.hxx
@@ -41,6 +41,7 @@ namespace SlideHack {
typedef boost::shared_ptr< class Store > StorePtr;
typedef boost::shared_ptr< class Group > GroupPtr;
+typedef boost::shared_ptr< class Origin > OriginPtr;
typedef boost::shared_ptr< class GroupMeta > GroupMetaPtr;
typedef boost::shared_ptr< class VersionData > VersionDataPtr;
typedef boost::shared_ptr< class Alternatives > AlternativesPtr;
@@ -56,18 +57,52 @@ public:
virtual OUString getCheckinComment() = 0;
};
+/// Tracking where a single slide came from
+class Origin
+{
+ friend class Store;
+private:
+ Origin( const OUString &rURL );
+public:
+ virtual ~Origin() {}
+ /// get a URL for our origin, which encodes version, alternative, etc.
+ OUString getURL();
+};
+
+/// Tracking where a single slide came from and some policy around that
+class OriginDetails : Origin
+{
+public:
+ /// how should we set about updating data from this origin ?
+ enum UpdateType { ORIGIN_UPDATE_NEVER, ORIGIN_UPDATE_AUTO, ORIGIN_UPDATE_MANUAL };
+
+ OriginDetails( const Origin &rOrigin, UpdateType eUpdateType );
+ virtual ~OriginDetails() {}
+
+ UpdateType getUpdateType() { return meUpdateType; }
+ void setUpdateType( UpdateType eUpdateType) { meUpdateType = eUpdateType; }
+
+ /// for save
+ OUString toString();
+ /// for load
+ OUString fromString();
+private:
+ UpdateType meUpdateType;
+};
+
/// Defines information about a group of slides
class GroupMeta : public boost::enable_shared_from_this< GroupMeta >,
private boost::noncopyable
{
public:
virtual ~GroupMeta() {}
- virtual OUString getName() = 0;
- virtual OUString getUserName() = 0;
- virtual OUString getTopic() = 0;
+ virtual OUString getName() = 0;
+ virtual OUString getUserName() = 0;
+ virtual OUString getTopic() = 0;
/// number of slides
- virtual int getLength() = 0;
+ virtual int getLength() = 0;
+ virtual OriginPtr getOriginForSlide( sal_uInt32 nSlide ) = 0;
// Cedric: can this be easily fetched in one chunk ?
virtual VersionDataPtr getVersionData() = 0;
@@ -120,7 +155,7 @@ public:
/// used to create a group handle from a stored slide, so we can
/// check for updated versions etc.
- virtual GroupPtr createGroup( OUString aName, OUString aVersion ) = 0;
+ virtual GroupPtr createGroup( OriginPtr pOrigin ) = 0;
/// factory function: to get the root
static StorePtr getStore();
More information about the Libreoffice-commits
mailing list