assemble SfxStyleFamilies from more generic resource components
Change-Id: I25aa0d8bca1f16f5fc27d3b299709479a1635ea3
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <vcl/fixed.hxx>
|
||||
#include <vcl/lstbox.hxx>
|
||||
#include <vcl/vclmedit.hxx>
|
||||
#include <sfx2/styfitem.hxx>
|
||||
#include <sfx2/tabdlg.hxx>
|
||||
|
||||
/* expected:
|
||||
@@ -30,7 +31,6 @@
|
||||
SID_TEMPLATE_FAMILY : In: Family of Template
|
||||
*/
|
||||
|
||||
class SfxStyleFamilies;
|
||||
class SfxStyleFamilyItem;
|
||||
class SfxStyleSheetBase;
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include <sfx2/app.hxx>
|
||||
#include <sfx2/dllapi.h>
|
||||
#include <sfx2/shell.hxx>
|
||||
#include <sfx2/styfitem.hxx>
|
||||
#include <svtools/imgdef.hxx>
|
||||
#include <sal/types.h>
|
||||
#include <tools/fldunit.hxx>
|
||||
@@ -37,7 +38,6 @@ class SfxObjectFactory;
|
||||
class SfxModule;
|
||||
class SfxModule_Impl;
|
||||
class SfxSlotPool;
|
||||
class SfxStyleFamilies;
|
||||
struct SfxChildWinContextFactory;
|
||||
struct SfxChildWinFactory;
|
||||
struct SfxStbCtrlFactory;
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
const SfxItemSet& rSet );
|
||||
virtual void Invalidate(sal_uInt16 nId = 0) override;
|
||||
|
||||
SfxStyleFamilies* CreateStyleFamilies();
|
||||
virtual SfxStyleFamilies* CreateStyleFamilies() { return nullptr; }
|
||||
|
||||
static SfxModule* GetActiveModule( SfxViewFrame* pFrame=nullptr );
|
||||
static FieldUnit GetCurrentFieldUnit();
|
||||
|
@@ -111,8 +111,6 @@
|
||||
|
||||
#define RID_DEFAULTABOUT (RID_SFX_START+0)
|
||||
|
||||
#define DLG_STYLE_DESIGNER (RID_SFX_START+8)
|
||||
|
||||
#define STR_STYLE_FILTER_AUTO (RID_SFX_START+9)
|
||||
#define STR_STYLE_FILTER_USED (RID_SFX_START+10)
|
||||
#define STR_STYLE_FILTER_USERDEF (RID_SFX_START+11)
|
||||
|
@@ -25,64 +25,35 @@
|
||||
#include <vcl/bitmap.hxx>
|
||||
#include <vcl/image.hxx>
|
||||
#include <tools/rc.hxx>
|
||||
#include <tools/resary.hxx>
|
||||
#include <rsc/rscsfx.hxx>
|
||||
#include <vector>
|
||||
|
||||
struct SfxFilterTupel {
|
||||
struct SFX2_DLLPUBLIC SfxFilterTupel
|
||||
{
|
||||
OUString aName;
|
||||
sal_uInt16 nFlags;
|
||||
};
|
||||
typedef ::std::vector< SfxFilterTupel* > SfxStyleFilter;
|
||||
typedef std::vector<SfxFilterTupel> SfxStyleFilter;
|
||||
|
||||
// CLASS -----------------------------------------------------------------
|
||||
|
||||
class SfxStyleFamilyItem: public Resource
|
||||
class SFX2_DLLPUBLIC SfxStyleFamilyItem
|
||||
{
|
||||
Image aImage;
|
||||
Bitmap aBitmap;
|
||||
OUString aText;
|
||||
OUString aHelpText;
|
||||
SfxStyleFamily nFamily;
|
||||
OUString aText;
|
||||
Image aImage;
|
||||
SfxStyleFilter aFilterList;
|
||||
|
||||
public:
|
||||
SfxStyleFamilyItem( const ResId &rId );
|
||||
~SfxStyleFamilyItem();
|
||||
SfxStyleFamilyItem(SfxStyleFamily nFamily, const OUString &rName, const Image& rImage, const ResId &rStringArray);
|
||||
|
||||
const OUString& GetText() const { return aText; }
|
||||
SfxStyleFamily GetFamily() const { return nFamily; }
|
||||
const SfxStyleFilter& GetFilterList() const { return aFilterList; }
|
||||
const Image& GetImage() const { return aImage; }
|
||||
|
||||
|
||||
class GrantAccess { friend class SfxStyleFamilies; };
|
||||
void SetImage( const Image& _rImg ) { aImage = _rImg; }
|
||||
};
|
||||
|
||||
class SFX2_DLLPUBLIC SfxStyleFamilies: public Resource
|
||||
{
|
||||
::std::vector< SfxStyleFamilyItem* > aEntryList;
|
||||
|
||||
public:
|
||||
SfxStyleFamilies( const ResId &);
|
||||
SfxStyleFamilies( ) {};
|
||||
~SfxStyleFamilies();
|
||||
|
||||
size_t size() const
|
||||
{ return aEntryList.size(); }
|
||||
|
||||
const SfxStyleFamilyItem* at(size_t nIdx) const
|
||||
{ return aEntryList.empty() ? nullptr : aEntryList[nIdx]; }
|
||||
|
||||
/** updates the images of all single SfxStyleFamilyItems with new images from the given resource
|
||||
|
||||
<p>The resource must contain a local image lists, with the id being the integer equivalent for the
|
||||
requested bitmap mode, incremented by 1.</p>
|
||||
|
||||
<p>Usually, you will use the same resource which originally constructed the object.</p>
|
||||
*/
|
||||
void updateImages( const ResId& _rId );
|
||||
};
|
||||
using SfxStyleFamilies = std::vector<SfxStyleFamilyItem>;
|
||||
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user