2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 /* @file PromptModel.h
17 * @author Justyna Mejzner (j.kwiatkowsk@samsung.com)
18 * @author Jaroslaw Osmanski (j.osmanski@samsung.com)
23 #ifndef WRT_SRC_ACCESSCONTROL_ENGINE_PROMPT_MODEL_H_
24 #define WRT_SRC_ACCESSCONTROL_ENGINE_PROMPT_MODEL_H_
30 #include <dpl/optional_typedefs.h>
34 typedef std::vector<std::string> ButtonLabels;
39 PromptLabels(int promptType,
40 const Prompt::ButtonLabels& questionLabel,
41 const std::string& mainLabel);
42 DPL::OptionalString getCheckLabel() const;
43 bool isAllowed(const size_t buttonNumber) const;
44 int getPromptType() const;
45 const ButtonLabels& getButtonLabels() const;
46 const std::string& getMainLabel() const;
50 ButtonLabels m_buttonLabels;
51 std::string m_mainLabel;
54 typedef std::unique_ptr<PromptLabels> PromptLabelsPtr;
66 PromptAnswer(bool isAccessAllowed, Validity validity);
67 PromptAnswer(int aPromptType, unsigned int buttonAns, bool checkAns);
68 bool isAccessAllowed() const;
69 Validity getValidity() const;
72 bool m_isAccessAllowed;
79 static PromptLabels* getOneShotModel(const std::string& resourceId);
80 static PromptLabels* getSessionModel(const std::string& resourceId);
81 static PromptLabels* getBlanketModel(const std::string& resourceId);
94 #endif /* WRT_SRC_ACCESSCONTROL_ENGINE_PROMPT_MODEL_H_ */