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 
8 #ifndef FFA_LIST_VIEW_ITEM_H
9 #define FFA_LIST_VIEW_ITEM_H
10 
12 #include <map>
13 
14 
26 {
27 public:
31  virtual ~FFaListViewItem() { delete posExpInfo; }
32 
34  virtual const char** getListViewPixmap() const { return NULL; }
35 
37  bool setPositionInListView(const char* lvName, int pos);
39  int getPositionInListView(const char* lvName) const;
40 
42  bool setExpandedInListView(const char* lvName, bool exp);
44  bool getExpandedInListView(const char* lvName) const;
45 
47  bool isSubjectToLVPositioning(const char* lvName) const
48  { return this->getPositionInListView(lvName) > -1 || this->getItemID() > 0; }
49 
50 private:
52  typedef std::pair<int,bool> FFaPosExpPair;
54  typedef std::map<char const*,FFaPosExpPair> FFaPosExpMap;
55 
57 };
58 
59 #endif
Base class for list view items.
Definition: FFaListViewItem.H:26
bool setExpandedInListView(const char *lvName, bool exp)
Sets the expand status of this item in the named list view.
Definition: FFaListViewItem.C:41
bool isSubjectToLVPositioning(const char *lvName) const
Returns whether this item is positioned in the named list view.
Definition: FFaListViewItem.H:47
std::pair< int, bool > FFaPosExpPair
Position in list view and whether the item is expanded or not.
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:11
std::map< char const *, FFaPosExpPair > FFaPosExpMap
List view name to position and whether the item is expanded mapping.
Definition: FFaListViewItem.H:54
FFaPosExpMap * posExpInfo
Position and expand status mapping.
Definition: FFaListViewItem.H:56
bool getExpandedInListView(const char *lvName) const
Returns the expand status of this item in the named list view.
Definition: FFaListViewItem.C:59
virtual ~FFaListViewItem()
The destructor deletes the position and expand status mapping.
Definition: FFaListViewItem.H:31
int getPositionInListView(const char *lvName) const
Returns the position of this item in the named list view.
Definition: FFaListViewItem.C:29
virtual const char ** getListViewPixmap() const
Returns the pixmap of this item.
Definition: FFaListViewItem.H:34
FFaListViewItem()
Default constructor.
Definition: FFaListViewItem.H:29
Abstract interface class for list view items.
Definition: FFaViewItem.H:22
virtual int getItemID() const =0
Returns the user ID of this item.