AbaKus – a complex calculator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.9KB

  1. #ifndef ABAKUS_RESULTLISTVIEW_H
  2. #define ABAKUS_RESULTLISTVIEW_H
  3. /*
  4. * resultlistview.h - part of abakus
  5. * Copyright (C) 2004, 2005 Michael Pyne <michael.pyne@kdemail.net>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include <klistview.h>
  22. #include "numerictypes.h"
  23. class TDEPopupMenu;
  24. class TQLabel;
  25. class TQDragObject;
  26. class ResultListViewText;
  27. namespace ResultList {
  28. enum { ExpressionColumn = 0, ResultColumn, ShortcutColumn };
  29. }
  30. class ResultListView : public TDEListView
  31. {
  32. Q_OBJECT
  33. public:
  34. ResultListView(TQWidget *parent = 0, const char *name = "result list view");
  35. bool getStackValue(unsigned stackPosition, Abakus::number_t &result);
  36. ResultListViewText *lastItem() const;
  37. protected:
  38. virtual void contextMenuEvent(TQContextMenuEvent *e);
  39. virtual TQDragObject *dragObject();
  40. signals:
  41. void signalEntrySelected(const TQString &text);
  42. void signalResultSelected(const TQString &text);
  43. private slots:
  44. void slotDoubleClicked(TQListViewItem *item, const TQPoint & /* Ignored */, int c);
  45. void slotCopyResult();
  46. private:
  47. TDEPopupMenu *constructPopupMenu(const ResultListViewText *item);
  48. ResultListViewText *itemUnderCursor() const;
  49. ResultListViewText *m_itemRightClicked;
  50. };
  51. #endif