summaryrefslogtreecommitdiff
path: root/svl/inc
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2013-01-22 10:32:32 +0100
committerDavid Tardon <dtardon@redhat.com>2013-01-22 13:41:24 +0100
commitf8409911be702c988557903e44783e22a8029769 (patch)
tree430c0dc9ddede9fd45695af303a853ed4f5833ae /svl/inc
parent24578b804007d8c3201e5ed32b8485e1725c33c1 (diff)
do not second-guess which classes use a stylesheet
Change-Id: I76b23bcdca2e7394fd5ab67e8341f4cdb46f8a64
Diffstat (limited to 'svl/inc')
-rw-r--r--svl/inc/svl/style.hxx6
-rw-r--r--svl/inc/svl/stylesheetuser.hxx38
2 files changed, 43 insertions, 1 deletions
diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx
index 48557c5457d8..18c0cebcf0fb 100644
--- a/svl/inc/svl/style.hxx
+++ b/svl/inc/svl/style.hxx
@@ -34,6 +34,7 @@
#include <svl/lstner.hxx>
#include <svl/brdcst.hxx>
#include <svl/poolitem.hxx>
+#include <svl/stylesheetuser.hxx>
#include <svl/style.hrc>
@@ -267,7 +268,7 @@ public:
//=========================================================================
class SVL_DLLPUBLIC SfxStyleSheet: public SfxStyleSheetBase,
- public SfxListener, public SfxBroadcaster
+ public SfxListener, public SfxBroadcaster, public svl::StyleSheetUser
{
public:
TYPEINFO();
@@ -276,6 +277,9 @@ public:
SfxStyleSheet( const SfxStyleSheet& );
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+ virtual bool isUsedByModel() const;
+
virtual bool SetParent( const UniString& );
protected:
diff --git a/svl/inc/svl/stylesheetuser.hxx b/svl/inc/svl/stylesheetuser.hxx
new file mode 100644
index 000000000000..787263ff4a8e
--- /dev/null
+++ b/svl/inc/svl/stylesheetuser.hxx
@@ -0,0 +1,38 @@
+/* -*- 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 SVL_STYLESHEETUSER_HXX_INCLUDED
+#define SVL_STYLESHEETUSER_HXX_INCLUDED
+
+namespace svl
+{
+
+/** Test whether object that uses a stylesheet is used itself.
+
+ This interface should be implemented by all classes that use
+ a SfxStyleSheet (and listen on it). It can be queried by the stylesheet
+ to determine if it is really used.
+ */
+class StyleSheetUser
+{
+public:
+ /** Test whether this object is used.
+
+ @return true, if the object is used, false otherwise
+ */
+ virtual bool isUsedByModel() const = 0;
+protected:
+ ~StyleSheetUser() {}
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */