~mterry/unity-scopes-api/snap-root

« back to all changes in this revision

Viewing changes to include/unity/scopes/internal/ValueSliderLabelsImpl.h

  • Committer: CI Train Bot
  • Author(s): Pawel Stolowski
  • Date: 2016-03-17 22:35:14 UTC
  • mfrom: (261.1.54 staging)
  • Revision ID: ci-train-bot@canonical.com-20160317223514-dxndlxrg5jbi2oqk
Merged devel: use abigail for abi-compoliance checker (disabled for now due o abigail bugs); filters API changes.
Approved by: Michi Henning, PS Jenkins bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2015 Canonical Ltd
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU Lesser General Public License version 3 as
 
6
 * published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU Lesser General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 *
 
16
 * Authored by: Pawel Stolowski <pawel.stolowski@canonical.com>
 
17
 */
 
18
 
 
19
#pragma once
 
20
 
 
21
#include <unity/scopes/ValueSliderLabels.h>
 
22
#include <unity/scopes/Variant.h>
 
23
 
 
24
namespace unity
 
25
{
 
26
 
 
27
namespace scopes
 
28
{
 
29
 
 
30
namespace internal
 
31
{
 
32
 
 
33
class ValueSliderLabelsImpl
 
34
{
 
35
public:
 
36
    ValueSliderLabelsImpl(std::string const& min_label, std::string const& max_label);
 
37
    ValueSliderLabelsImpl(std::string const& min_label, std::string const& max_label, std::vector<std::pair<double, std::string>> const& extra_labels);
 
38
    ValueSliderLabelsImpl(VariantMap const& var);
 
39
    ValueSliderLabelsImpl(ValueSliderLabelsImpl const&) = default;
 
40
 
 
41
    std::string min_label() const;
 
42
    std::string max_label() const;
 
43
    std::vector<std::pair<double, std::string>> extra_labels() const;
 
44
    VariantMap serialize() const;
 
45
    void deserialize(VariantMap const& var);
 
46
 
 
47
    void validate(double min, double max) const;
 
48
 
 
49
private:
 
50
    std::string min_label_;
 
51
    std::string max_label_;
 
52
    std::vector<std::pair<double, std::string>> extra_labels_;
 
53
};
 
54
 
 
55
}
 
56
 
 
57
}
 
58
 
 
59
}