summaryrefslogtreecommitdiff
path: root/svx/source/inc
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-11-21 14:28:30 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-11-21 14:28:30 +0000
commit879d69b8c2315ae41c7db0d76de1db3b34597d15 (patch)
tree2ca63e956015a0171c44ef3b0ddfdb94c91fac18 /svx/source/inc
parentd9a0ad5cd20c6abb3cd8ea1ddb88f0bb196ec220 (diff)
INTEGRATION: CWS dba24c (1.1.2); FILE ADDED
2007/09/05 07:55:01 fs 1.1.2.1: #i80879#
Diffstat (limited to 'svx/source/inc')
-rw-r--r--svx/source/inc/stringlistresource.hxx95
1 files changed, 95 insertions, 0 deletions
diff --git a/svx/source/inc/stringlistresource.hxx b/svx/source/inc/stringlistresource.hxx
new file mode 100644
index 000000000000..b40e67ea5df0
--- /dev/null
+++ b/svx/source/inc/stringlistresource.hxx
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: stringlistresource.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: ihi $ $Date: 2007-11-21 15:28:30 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
+#ifndef SVX_STRINGLISTRESOURCE_HXX
+#define SVX_STRINGLISTRESOURCE_HXX
+
+/** === begin UNO includes === **/
+/** === end UNO includes === **/
+
+#include <tools/rc.hxx>
+
+#include <memory>
+
+//........................................................................
+namespace svx
+{
+//........................................................................
+
+ //====================================================================
+ //= StringListResource
+ //====================================================================
+ /** loads a list of strings from a resource, where the resource is of type RSC_RESOURCE,
+ and has sub resources of type string, numbered from 1 to n
+ */
+ class StringListResource : public Resource
+ {
+ public:
+ StringListResource( const ResId& _rResId );
+ ~StringListResource();
+
+ inline void get( ::std::vector< String >& _rStrings )
+ {
+ _rStrings = m_aStrings;
+ }
+
+
+ /** returns the String with a given local resource id
+
+ @param _nResId
+ The resource id. It will not be checked if this id exists.
+
+ @return String
+ The string.
+ */
+ String getString( USHORT _nResId )
+ {
+ return String( ResId( _nResId, *m_pResMgr ) );
+ }
+
+ size_t size() const { return m_aStrings.size(); }
+ bool empty() const { return m_aStrings.empty(); }
+
+ const String& operator[]( size_t _index ) const { return m_aStrings[ _index ]; }
+
+ private:
+ ::std::vector< String > m_aStrings;
+ };
+
+//........................................................................
+} // namespace svx
+//........................................................................
+
+#endif // SVX_STRINGLISTRESOURCE_HXX