Iridescence 1.00
Embedded Graphic Framework
Loading...
Searching...
No Matches
ds_selection_base.h
1/* Copyright (C) 2017 - 2024, Thornwave Labs Inc - All Rights Reserved.
2 * Unauthorized copying of this file, via any medium is strictly prohibited.
3 * Proprietary and confidential.
4 * Written by Razvan Turiac <razvan.turiac@thornwave.com>
5*/
6
7#ifndef _DS_SELECTION_BASE_H
8#define _DS_SELECTION_BASE_H
9
10
11#include <ds_math.h>
12#include <ds_types_lambda.h>
13
14
19{
20public:
22
23
28 void setSelection(int32_t selection);
29
30
35 int32_t getSelection(void) const;
36
37
47 void setOnChangeCallback(const lambda<void(int32_t selection, bool in_motion, bool user_input)> &cb);
48
49
50protected:
51 int32_t mSelectionCount;
52 int32_t mSelection;
53
54 virtual void getSelectionCount(void);
55 void notifySelectionChange(bool in_motion);
56
57 virtual int32_t onSelectionChange(int32_t selection) = 0;
58
59
60private:
61 float mRecursionFlag;
62 lambda<void(int32_t, bool, bool)> mOnChangeCallback;
63};
64
65
66#endif
DsSelectionBase is a base class that contains a selection value.
Definition ds_selection_base.h:19
void setSelection(int32_t selection)
Sets the selection value.
void setOnChangeCallback(const lambda< void(int32_t selection, bool in_motion, bool user_input)> &cb)
int32_t getSelection(void) const
Returns the selection value.
Definition ds_types_lambda.h:24