Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / include / vcl / IContext.hxx
blob841c9d69e8280a27da36c906441456fe4d8d0fe6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef INCLUDED_VCL_ICONTEXT_HXX
11 #define INCLUDED_VCL_ICONTEXT_HXX
13 #include <vcl/EnumContext.hxx>
14 #include <vector>
16 namespace vcl
19 class VCL_DLLPUBLIC IContext
21 protected:
22 IContext()
24 maContext.push_back( vcl::EnumContext::Context::Any );
27 public:
28 void SetContext(const std::vector<vcl::EnumContext::Context>& aContext)
30 maContext = aContext;
33 bool HasContext( const vcl::EnumContext::Context eContext ) const
35 auto aFind = std::find(maContext.begin(), maContext.end(), eContext);
36 if (aFind == maContext.end())
37 return false;
38 return true;
41 private:
42 std::vector<vcl::EnumContext::Context> maContext;
45 } // namespace vcl
47 #endif // INCLUDED_VCL_ICONTEXT_HXX
49 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */