1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef SVX_STRINGLISTRESOURCE_HXX
30 #define SVX_STRINGLISTRESOURCE_HXX
32 #include <tools/rc.hxx>
34 #include <svx/svxdllapi.h>
38 //........................................................................
41 //........................................................................
43 //====================================================================
44 //= StringListResource
45 //====================================================================
46 /** loads a list of strings from a resource, where the resource is of type RSC_RESOURCE,
47 and has sub resources of type string, numbered from 1 to n
49 class StringListResource
: public Resource
52 SVX_DLLPUBLIC
StringListResource( const ResId
& _rResId
);
53 SVX_DLLPUBLIC
~StringListResource();
55 inline void get( ::std::vector
< String
>& _rStrings
)
57 _rStrings
= m_aStrings
;
61 /** returns the String with a given local resource id
64 The resource id. It will not be checked if this id exists.
69 String
getString( sal_uInt16 _nResId
)
71 return String( ResId( _nResId
, *m_pResMgr
) );
74 size_t size() const { return m_aStrings
.size(); }
75 bool empty() const { return m_aStrings
.empty(); }
77 const String
& operator[]( size_t _index
) const { return m_aStrings
[ _index
]; }
80 ::std::vector
< String
> m_aStrings
;
83 //........................................................................
85 //........................................................................
87 #endif // SVX_STRINGLISTRESOURCE_HXX
89 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */