Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_svx / xit.hxx
blob8a17b1d519a2ed3370d01b4495da1557e6ae8d16
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xit.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _SVX_XIT_HXX
32 #define _SVX_XIT_HXX
34 #ifndef _SFXSTRITEM_HXX //autogen
35 #include <bf_svtools/stritem.hxx>
36 #endif
37 namespace binfilter {
39 class SfxItemPool;
41 /************************************************************************/
43 extern String aNameOrIndexEmptyString;
45 /************************************************************************/
47 class XColorTable;
48 class XDashTable;
49 class XLineEndTable;
50 class XHatchTable;
51 class XBitmapTable;
52 class XGradientTable;
53 class NameOrIndex;
54 class XPropertyList;
56 typedef BOOL (*SvxCompareValueFunc)( const NameOrIndex* p1, const NameOrIndex* p2 );
58 //-------------------
59 // class NameOrIndex
60 //-------------------
61 class NameOrIndex : public SfxStringItem
63 long nPalIndex;
65 protected:
66 void Detach() { nPalIndex = -1; }
68 public:
69 TYPEINFO();
70 NameOrIndex() { nPalIndex = -1; }
71 NameOrIndex(USHORT nWhich, long nIndex);
72 NameOrIndex(USHORT nWhich,
73 const String& rName= aNameOrIndexEmptyString);
74 NameOrIndex(USHORT nWhich, SvStream& rIn);
75 NameOrIndex(const NameOrIndex& rNameOrIndex);
76 ~NameOrIndex() {};
78 virtual int operator==(const SfxPoolItem& rItem) const;
79 virtual SvStream& Store(SvStream& rOut, USHORT nItemVersion ) const;
81 String GetName() const { return GetValue(); }
82 void SetName(const String& rName) { SetValue(rName); }
83 long GetIndex() const { return nPalIndex; }
84 void SetIndex(long nIndex) { nPalIndex = nIndex; }
85 BOOL IsIndex() const { return (nPalIndex >= 0); }
87 /** this static checks if the given NameOrIndex item has a unique name for its value.
88 The returned String is a unique name for an item with this value in both given pools.
89 Argument pPool2 can be null.
90 If returned string equals NameOrIndex->GetName(), the name was already unique.
92 static String CheckNamedItem( const NameOrIndex* pCheckItem, const sal_uInt16 nWhich, const SfxItemPool* pPool1, const SfxItemPool* pPool2, SvxCompareValueFunc pCompareValueFunc, USHORT nPrefixResId, XPropertyList* pDefaults = NULL );
95 }//end of namespace binfilter
96 #endif