1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SVX_STRINGLISTRESOURCE_HXX
21 #define SVX_STRINGLISTRESOURCE_HXX
23 #include <tools/rc.hxx>
25 #include <svx/svxdllapi.h>
29 //........................................................................
32 //........................................................................
34 //====================================================================
35 //= StringListResource
36 //====================================================================
37 /** loads a list of strings from a resource, where the resource is of type RSC_RESOURCE,
38 and has sub resources of type string, numbered from 1 to n
40 class StringListResource
: public Resource
43 SVX_DLLPUBLIC
StringListResource( const ResId
& _rResId
);
44 SVX_DLLPUBLIC
~StringListResource();
46 inline void get( ::std::vector
< String
>& _rStrings
)
48 _rStrings
= m_aStrings
;
52 /** returns the String with a given local resource id
55 The resource id. It will not be checked if this id exists.
60 String
getString( sal_uInt16 _nResId
)
62 return String( ResId( _nResId
, *m_pResMgr
) );
65 size_t size() const { return m_aStrings
.size(); }
66 bool empty() const { return m_aStrings
.empty(); }
68 const String
& operator[]( size_t _index
) const { return m_aStrings
[ _index
]; }
71 ::std::vector
< String
> m_aStrings
;
74 //........................................................................
76 //........................................................................
78 #endif // SVX_STRINGLISTRESOURCE_HXX
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */