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 KPopupMenu;
  24. class TQLabel;
  25. class TQDragObject;
  26. class ResultListViewText;
  27. namespace ResultList {
  28. enum { ExpressionColumn = 0, ResultColumn, ShortcutColumn };
  29. }
  30. class ResultListView : public KListView
  31. {
  32. Q_OBJECT
  33. TQ_OBJECT
  34. public:
  35. ResultListView(TQWidget *parent = 0, const char *name = "result list view");
  36. bool getStackValue(unsigned stackPosition, Abakus::number_t &result);
  37. ResultListViewText *lastItem() const;
  38. protected:
  39. virtual void contextMenuEvent(TQContextMenuEvent *e);
  40. virtual TQDragObject *dragObject();
  41. signals:
  42. void signalEntrySelected(const TQString &text);
  43. void signalResultSelected(const TQString &text);
  44. private slots:
  45. void slotDoubleClicked(TQListViewItem *item, const TQPoint & /* Ignored */, int c);
  46. void slotCopyResult();
  47. private:
  48. KPopupMenu *constructPopupMenu(const ResultListViewText *item);
  49. ResultListViewText *itemUnderCursor() const;
  50. ResultListViewText *m_itemRightClicked;
  51. };
  52. #endif