libyui-rest-api
 
Loading...
Searching...
No Matches
YTableActionHandler.h
1/*
2 Copyright (C) 2020 SUSE LLC
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) version 3.0 of the License. This library
8 is distributed in the hope that it will be useful, but WITHOUT ANY
9 WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
11 License for more details. You should have received a copy of the GNU
12 Lesser General Public License along with this library; if not, write
13 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
14 Floor, Boston, MA 02110-1301 USA
15*/
16
17#ifndef YTableActionHandler_h
18#define YTableActionHandler_h
19
20#include <functional>
21
22#include <yui/YTable.h>
23#include <yui/YTableItem.h>
24
25#include "YWidgetActionHandler.h"
26
27#define TablePathDelimiter "|"
28
29
30class YTableActionHandler : public YWidgetActionHandler
31{
32public:
33
34 YTableActionHandler() {};
35 virtual ~YTableActionHandler() {};
36
37public:
38 std::function<void (YTable*)> get_handler( YTable * widget,
39 const std::string &value,
40 const int &column_id = 0, //Use first column by default
41 const int &row_id = -1 );
42
43 virtual void activate_table_widget( YTable * widget, YItem * item ) {};
44
45protected:
46 static YTableItem * table_findItem( std::vector<std::string>::const_iterator path_begin,
47 std::vector<std::string>::const_iterator path_end,
48 YItemConstIterator begin,
49 YItemConstIterator end,
50 const int &column_id );
51};
52
53#endif // YTableActionHandler_h