summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-04-10 15:53:49 +0100
committerMichael Meeks <michael.meeks@suse.com>2013-04-10 15:53:49 +0100
commit21346ce5d21ee34b420159d9a737093b0a5cfe78 (patch)
tree073ec8b7f701c318c4f09297c4e3a413083d52ec
parentadd slide grouping / un-grouping hooks. (diff)
downloadcore-21346ce5d21ee34b420159d9a737093b0a5cfe78.tar.gz
core-21346ce5d21ee34b420159d9a737093b0a5cfe78.zip
tag each slide with it's origin.
Change-Id: I71e47cb5bbbbdbca8e70d846ff5e504c6edb01bd
-rw-r--r--sd/inc/sdpage.hxx9
-rw-r--r--sd/inc/slidehack.hxx45
2 files changed, 49 insertions, 5 deletions
diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx
index 0b5d631b24a5..1cfe4e8526ee 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 822e160e3e51..6ff52b4a266f 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();