TDE System Settings – easy to use control center
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.
 
 
 
 
 
 

69 lines
2.1 KiB

  1. /**
  2. * This file is part of the System Settings package
  3. * Copyright (C) 2005 Benjamin C Meyer
  4. * <ben+systempreferences at meyerhome dot net>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public License
  17. * along with this library; see the file COPYING.LIB. If not, write to
  18. * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
  19. * Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef KCMSEARCH_H
  22. #define KCMSEARCH_H
  23. #include <kiconviewsearchline.h>
  24. #include "kcmodulemenu.h"
  25. class ModulesView;
  26. /**
  27. * Searches all the ModuleIconItem's in MainWindow and "disables" the ones
  28. * whos keywords don't match the current search.
  29. */
  30. class KcmSearch : public KIconViewSearchLine
  31. {
  32. Q_OBJECT
  33. TQ_OBJECT
  34. public:
  35. KcmSearch( TQPtrList<ModulesView> *moduleViewList, TQWidget *parent = 0, const char *name = 0 );
  36. public slots:
  37. /**
  38. * Go through all of the iconView groups in mainView and update
  39. */
  40. virtual void updateSearch( const TQString &search = TQString() );
  41. /**
  42. * Check module associated with item or if a group check all modules of that group.
  43. * @return true if search is in the module(s) keywords
  44. */
  45. virtual bool itemMatches ( const TQIconViewItem *item, const TQString &search ) const;
  46. signals:
  47. void searchHits(const TQString &query, int *hitList, int length);
  48. private:
  49. /**
  50. * Determine if module matches the search
  51. * @return true if search is in module's keywords
  52. */
  53. bool itemMatches ( const KCModuleInfo &module, const TQString &search ) const;
  54. // Friend class whos groups parsed,
  55. TQPtrList<ModulesView> *moduleViewList;
  56. };
  57. #endif // KCMSEARCH_H