FEDEM Solver  R8.0
Source code of the dynamics solver
FFaListViewItem.H
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2023 SAP SE
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 // This file is part of FEDEM - https://openfedem.org
7 
13 #ifndef FFA_LIST_VIEW_ITEM_H
14 #define FFA_LIST_VIEW_ITEM_H
15 
17 #include <map>
18 
19 
31 {
32 public:
36  virtual ~FFaListViewItem() { delete posExpInfo; }
37 
39  virtual const char** getListViewPixmap() const { return NULL; }
40 
42  bool setPositionInListView(const char* lvName, int pos);
44  int getPositionInListView(const char* lvName) const;
45 
47  bool setExpandedInListView(const char* lvName, bool exp);
49  bool getExpandedInListView(const char* lvName) const;
50 
52  bool isSubjectToLVPositioning(const char* lvName) const
53  { return this->getPositionInListView(lvName) > -1 || this->getItemID() > 0; }
54 
55 private:
57  using FFaPosExpPair = std::pair<int,bool>;
59  using FFaPosExpMap = std::map<char const*,FFaPosExpPair>;
60 
62 };
63 
64 #endif
Abstract interface for list view items.
Base class for list view items.
Definition: FFaListViewItem.H:31
bool setExpandedInListView(const char *lvName, bool exp)
Sets the expand status of this item in the named list view.
Definition: FFaListViewItem.C:46
bool isSubjectToLVPositioning(const char *lvName) const
Returns whether this item is positioned in the named list view.
Definition: FFaListViewItem.H:52
bool setPositionInListView(const char *lvName, int pos)
Sets the position of this item in the named list view.
Definition: FFaListViewItem.C:16
FFaPosExpMap * posExpInfo
Position and expand status mapping.
Definition: FFaListViewItem.H:61
std::pair< int, bool > FFaPosExpPair
Position in list view and whether the item is expanded or not.
Definition: FFaListViewItem.H:57
bool getExpandedInListView(const char *lvName) const
Returns the expand status of this item in the named list view.
Definition: FFaListViewItem.C:64
std::map< char const *, FFaPosExpPair > FFaPosExpMap
List view name to position and whether the item is expanded mapping.
Definition: FFaListViewItem.H:59
virtual ~FFaListViewItem()
The destructor deletes the position and expand status mapping.
Definition: FFaListViewItem.H:36
int getPositionInListView(const char *lvName) const
Returns the position of this item in the named list view.
Definition: FFaListViewItem.C:34
virtual const char ** getListViewPixmap() const
Returns the pixmap of this item.
Definition: FFaListViewItem.H:39
FFaListViewItem()
Default constructor.
Definition: FFaListViewItem.H:34
Abstract interface class for list view items.
Definition: FFaViewItem.H:27
virtual int getItemID() const =0
Returns the user ID of this item.