summaryrefslogtreecommitdiffabout
path: root/microkde/kdecore/kshortcut.h
Unidiff
Diffstat (limited to 'microkde/kdecore/kshortcut.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/kshortcut.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/microkde/kdecore/kshortcut.h b/microkde/kdecore/kshortcut.h
index 4813734..244d590 100644
--- a/microkde/kdecore/kshortcut.h
+++ b/microkde/kdecore/kshortcut.h
@@ -470,238 +470,238 @@ class KKey
470 */ 470 */
471 //USbool operator == ( const KKeySequence& seq ) const 471 //USbool operator == ( const KKeySequence& seq ) const
472 //US { return compare( seq ) == 0; } 472 //US { return compare( seq ) == 0; }
473 473
474 /** 474 /**
475 * Compares the keys of both sequences. 475 * Compares the keys of both sequences.
476 * @see compare() 476 * @see compare()
477 */ 477 */
478 //USbool operator != ( const KKeySequence& seq ) const 478 //USbool operator != ( const KKeySequence& seq ) const
479 //US { return compare( seq ) != 0; } 479 //US { return compare( seq ) != 0; }
480 480
481 /** 481 /**
482 * Compares the keys of both sequences. 482 * Compares the keys of both sequences.
483 * @see compare() 483 * @see compare()
484 */ 484 */
485 //USbool operator < ( const KKeySequence& seq ) const 485 //USbool operator < ( const KKeySequence& seq ) const
486 //US { return compare( seq ) < 0; } 486 //US { return compare( seq ) < 0; }
487 // TODO: consider adding Qt::SequenceMatch matches(...) methods for QKeySequence equivalence 487 // TODO: consider adding Qt::SequenceMatch matches(...) methods for QKeySequence equivalence
488 488
489 /** 489 /**
490 * Converts this key sequence to a QKeySequence. 490 * Converts this key sequence to a QKeySequence.
491 * @return the QKeySequence 491 * @return the QKeySequence
492 */ 492 */
493 //USQKeySequence qt() const; 493 //USQKeySequence qt() const;
494 494
495 /** 495 /**
496 * Returns the qt key code of the first key. 496 * Returns the qt key code of the first key.
497 * @return the qt key code of the first key 497 * @return the qt key code of the first key
498 * @see Qt::Key 498 * @see Qt::Key
499 * @see KKey::keyCodeQt() 499 * @see KKey::keyCodeQt()
500 */ 500 */
501 //USint keyCodeQt() const; 501 //USint keyCodeQt() const;
502 502
503 /** 503 /**
504 * Returns the key sequence as a number of key presses as 504 * Returns the key sequence as a number of key presses as
505 * returned by @ref KKey::toString(), seperated by commas. 505 * returned by @ref KKey::toString(), seperated by commas.
506 * @return the string represenation of this key sequence 506 * @return the string represenation of this key sequence
507 * @see KKey::toString() 507 * @see KKey::toString()
508 */ 508 */
509 //USQString toString() const; 509 //USQString toString() const;
510 510
511 /** 511 /**
512 * @internal 512 * @internal
513 */ 513 */
514//US QString toStringInternal() const; 514//US QString toStringInternal() const;
515 515
516 /** 516 /**
517 * Returns a null key sequence. 517 * Returns a null key sequence.
518 * @return the null key sequence 518 * @return the null key sequence
519 * @see isNull() 519 * @see isNull()
520 * @see clear() 520 * @see clear()
521 */ 521 */
522 //USstatic KKeySequence& null(); 522 //USstatic KKeySequence& null();
523 523
524//US protected: 524//US protected:
525 //USuchar m_nKeys; 525 //USuchar m_nKeys;
526 //USuchar m_bTriggerOnRelease; 526 //USuchar m_bTriggerOnRelease;
527 // BCI: m_rgvar should be renamed to m_rgkey for KDE 4.0 527 // BCI: m_rgvar should be renamed to m_rgkey for KDE 4.0
528 //USKKey m_rgvar[MAX_KEYS]; 528 //USKKey m_rgvar[MAX_KEYS];
529 529
530//US private: 530//US private:
531 //USclass KKeySequencePrivate* d; 531 //USclass KKeySequencePrivate* d;
532 //USfriend class KKeyNative; 532 //USfriend class KKeyNative;
533//US}; 533//US};
534 534
535/** 535/**
536* The KShortcut class is used to represent a keyboard shortcut to an action. 536* The KShortcut class is used to represent a keyboard shortcut to an action.
537* A shortcut is normally a single key with modifiers, such as Ctrl+V. 537* A shortcut is normally a single key with modifiers, such as Ctrl+V.
538* A KShortcut object may also contain an alternate key which will also 538* A KShortcut object may also contain an alternate key which will also
539* activate the action it's associated to, as long as no other actions have 539* activate the action it's associated to, as long as no other actions have
540* defined that key as their primary key. Ex: Ctrl+V;Shift+Insert. 540* defined that key as their primary key. Ex: Ctrl+V;Shift+Insert.
541*/ 541*/
542 542
543class KShortcut 543class KShortcut
544{ 544{
545 public: 545 public:
546 /** 546 /**
547 * The maximum number of key sequences that can be contained in 547 * The maximum number of key sequences that can be contained in
548 * a KShortcut. 548 * a KShortcut.
549 */ 549 */
550 enum { MAX_SEQUENCES = 2 }; 550 enum { MAX_SEQUENCES = 2 };
551 551
552 /** 552 /**
553 * Creates a new null shortcut. 553 * Creates a new null shortcut.
554 * @see null() 554 * @see null()
555 * @see isNull() 555 * @see isNull()
556 * @see clear() 556 * @see clear()
557 */ 557 */
558 KShortcut() {} 558 KShortcut() {}
559 559
560 /** 560 /**
561 * Creates a new shortcut with the given Qt key code 561 * Creates a new shortcut with the given Qt key code
562 * as the only key sequence. 562 * as the only key sequence.
563 * @param keyQt the qt keycode 563 * @param keyQt the qt keycode
564 * @see Qt::Key 564 * @see Qt::Key
565 */ 565 */
566 KShortcut( int keyQt ) {} 566 KShortcut( int /*keyQt */) {}
567 567
568 /** 568 /**
569 * Creates a new shortcut that contains only the given qt key 569 * Creates a new shortcut that contains only the given qt key
570 * sequence. 570 * sequence.
571 * @param keySeq the qt key sequence to add 571 * @param keySeq the qt key sequence to add
572 */ 572 */
573 //USKShortcut( const QKeySequence& keySeq ) {} 573 //USKShortcut( const QKeySequence& keySeq ) {}
574 574
575 /** 575 /**
576 * Creates a new shortcut that contains only the given key 576 * Creates a new shortcut that contains only the given key
577 * in its only sequence. 577 * in its only sequence.
578 * @param key the key to add 578 * @param key the key to add
579 */ 579 */
580 //USKShortcut( const KKey& key ); 580 //USKShortcut( const KKey& key );
581 581
582 /** 582 /**
583 * Creates a new shortcut that contains only the given key 583 * Creates a new shortcut that contains only the given key
584 * sequence. 584 * sequence.
585 * @param keySeq the key sequence to add 585 * @param keySeq the key sequence to add
586 */ 586 */
587 //USKShortcut( const KKeySequence& keySeq ); 587 //USKShortcut( const KKeySequence& keySeq );
588 588
589 /** 589 /**
590 * Copies the given shortcut. 590 * Copies the given shortcut.
591 * @param shortcut the shortcut to add 591 * @param shortcut the shortcut to add
592 */ 592 */
593 //USKShortcut( const KShortcut& shortcut ); 593 //USKShortcut( const KShortcut& shortcut );
594 594
595 /** 595 /**
596 * Creates a new key sequence that contains the given key sequence. 596 * Creates a new key sequence that contains the given key sequence.
597 * The description consists of semicolon-separated keys as 597 * The description consists of semicolon-separated keys as
598 * used in @ref KKeySequence::KKeySequence(const QString&). 598 * used in @ref KKeySequence::KKeySequence(const QString&).
599 * @param shortcut the description of the key 599 * @param shortcut the description of the key
600 * @see KKeySequence::KKeySequence(const QString&) 600 * @see KKeySequence::KKeySequence(const QString&)
601 */ 601 */
602 KShortcut( const char* shortcut ) {} 602 KShortcut( const char* /*shortcut */) {}
603 603
604 /** 604 /**
605 * Creates a new key sequence that contains the given key sequence. 605 * Creates a new key sequence that contains the given key sequence.
606 * The description consists of semicolon-separated keys as 606 * The description consists of semicolon-separated keys as
607 * used in @ref KKeySequence::KKeySequence(const QString&). 607 * used in @ref KKeySequence::KKeySequence(const QString&).
608 * @param shortcut the description of the key 608 * @param shortcut the description of the key
609 * @see KKeySequence::KKeySequence(const QString&) 609 * @see KKeySequence::KKeySequence(const QString&)
610 */ 610 */
611 KShortcut( const QString& shortcut ) {} 611 KShortcut( const QString& /*shortcut */) {}
612 ~KShortcut() {} 612 ~KShortcut() {}
613 613
614 /** 614 /**
615 * Clears the shortcut. The shortcut is null after calling this 615 * Clears the shortcut. The shortcut is null after calling this
616 * function. 616 * function.
617 * @see isNull() 617 * @see isNull()
618 */ 618 */
619 //USvoid clear(); 619 //USvoid clear();
620 620
621 /** 621 /**
622 * Initializes the shortcut with the given Qt key code 622 * Initializes the shortcut with the given Qt key code
623 * as the only key sequence. 623 * as the only key sequence.
624 * @param keyQt the qt keycode 624 * @param keyQt the qt keycode
625 * @see Qt::Key 625 * @see Qt::Key
626 */ 626 */
627 //USbool init( int keyQt ); 627 //USbool init( int keyQt );
628 628
629 /** 629 /**
630 * Initializes the shortcut with the given qt key sequence. 630 * Initializes the shortcut with the given qt key sequence.
631 * @param keySeq the qt key sequence to add 631 * @param keySeq the qt key sequence to add
632 */ 632 */
633 //USbool init( const QKeySequence& keySeq ); 633 //USbool init( const QKeySequence& keySeq );
634 634
635 /** 635 /**
636 * Initializes the shortcut with the given key as its only sequence. 636 * Initializes the shortcut with the given key as its only sequence.
637 * @param key the key to add 637 * @param key the key to add
638 */ 638 */
639 //USbool init( const KKey& key ); 639 //USbool init( const KKey& key );
640 640
641 /** 641 /**
642 * Initializes the shortcut with the given qt key sequence. 642 * Initializes the shortcut with the given qt key sequence.
643 * @param keySeq the qt key sequence to add 643 * @param keySeq the qt key sequence to add
644 */ 644 */
645 //USbool init( const KKeySequence& keySeq ); 645 //USbool init( const KKeySequence& keySeq );
646 646
647 /** 647 /**
648 * Copies the given shortcut. 648 * Copies the given shortcut.
649 * @param shortcut the shortcut to add 649 * @param shortcut the shortcut to add
650 */ 650 */
651 //USbool init( const KShortcut& shortcut ); 651 //USbool init( const KShortcut& shortcut );
652 652
653 /** 653 /**
654 * Initializes the key sequence with the given key sequence. 654 * Initializes the key sequence with the given key sequence.
655 * The description consists of semicolon-separated keys as 655 * The description consists of semicolon-separated keys as
656 * used in @ref KKeySequence::KKeySequence(const QString&). 656 * used in @ref KKeySequence::KKeySequence(const QString&).
657 * @param shortcut the description of the key 657 * @param shortcut the description of the key
658 * @see KKeySequence::KKeySequence(const QString&) 658 * @see KKeySequence::KKeySequence(const QString&)
659 */ 659 */
660 //USbool init( const QString& shortcut ); 660 //USbool init( const QString& shortcut );
661 661
662 /** 662 /**
663 * Copies the given shortcut over this shortcut. 663 * Copies the given shortcut over this shortcut.
664 */ 664 */
665 //USKShortcut& operator =( const KShortcut& cut ) 665 //USKShortcut& operator =( const KShortcut& cut )
666 //US { init( cut ); return *this; } 666 //US { init( cut ); return *this; }
667 667
668 /** 668 /**
669 * Returns the number of sequences that are in this 669 * Returns the number of sequences that are in this
670 * shortcut. 670 * shortcut.
671 * @return the number of sequences 671 * @return the number of sequences
672 * @ref MAX_SEQUENCES 672 * @ref MAX_SEQUENCES
673 */ 673 */
674 //USuint count() const; 674 //USuint count() const;
675 675
676 /** 676 /**
677 * Returns the @p i'th key sequence of this shortcut. 677 * Returns the @p i'th key sequence of this shortcut.
678 * @param i the number of the key sequence to retrieve 678 * @param i the number of the key sequence to retrieve
679 * @return the @p i'th sequence or @ref KKeySequence::null() if 679 * @return the @p i'th sequence or @ref KKeySequence::null() if
680 * there are less than @p i key sequences 680 * there are less than @p i key sequences
681 * @ref MAX_SEQUENCES 681 * @ref MAX_SEQUENCES
682 */ 682 */
683 //USconst KKeySequence& seq( uint i ) const; 683 //USconst KKeySequence& seq( uint i ) const;
684 684
685 /** 685 /**
686 * Returns the key code of the first key sequence, or 686 * Returns the key code of the first key sequence, or
687 * null if there is no first key sequence. 687 * null if there is no first key sequence.
688 * @return the key code of the first sequence's first key 688 * @return the key code of the first sequence's first key
689 * @see Qt::Key 689 * @see Qt::Key
690 * @see KKeySequence::keyCodeQt() 690 * @see KKeySequence::keyCodeQt()
691 */ 691 */
692 //USint keyCodeQt() const; 692 //USint keyCodeQt() const;
693 693
694 /** 694 /**
695 * Returns true if the shortcut is null (after @ref clear() or empty 695 * Returns true if the shortcut is null (after @ref clear() or empty
696 * constructor). 696 * constructor).
697 * @return true if the shortcut is null 697 * @return true if the shortcut is null
698 * @see clear() 698 * @see clear()
699 * @see null() 699 * @see null()
700 */ 700 */
701 bool isNull() const { return true; } 701 bool isNull() const { return true; }
702 702
703 /** 703 /**
704 * Compares this object with the given shortcut. Returns a negative 704 * Compares this object with the given shortcut. Returns a negative
705 * number if the given shortcut is larger, 0 if they are equal and 705 * number if the given shortcut is larger, 0 if they are equal and
706 * a positive number this shortcut is larger. Shortcuts are 706 * a positive number this shortcut is larger. Shortcuts are
707 * compared by comparing the individual key sequences, starting from the 707 * compared by comparing the individual key sequences, starting from the
@@ -723,124 +723,124 @@ class KShortcut
723 //US { return compare( cut ) == 0; } 723 //US { return compare( cut ) == 0; }
724 724
725 /** 725 /**
726 * Compares the sequences of both shortcuts. 726 * Compares the sequences of both shortcuts.
727 * @see compare() 727 * @see compare()
728 */ 728 */
729 //USbool operator != ( const KShortcut& cut ) const 729 //USbool operator != ( const KShortcut& cut ) const
730 //US { return compare( cut ) != 0; } 730 //US { return compare( cut ) != 0; }
731 731
732 /** 732 /**
733 * Compares the sequences of both shortcuts. 733 * Compares the sequences of both shortcuts.
734 * @see compare() 734 * @see compare()
735 */ 735 */
736 //USbool operator < ( const KShortcut& cut ) const 736 //USbool operator < ( const KShortcut& cut ) const
737 //US { return compare( cut ) < 0; } 737 //US { return compare( cut ) < 0; }
738 738
739 /** 739 /**
740 * Checks whether this shortcut contains a sequence that starts 740 * Checks whether this shortcut contains a sequence that starts
741 * with the given key. 741 * with the given key.
742 * @param key the key to check 742 * @param key the key to check
743 * @return true if a key sequence starts with the key 743 * @return true if a key sequence starts with the key
744 */ 744 */
745 //USbool contains( const KKey& key ) const; 745 //USbool contains( const KKey& key ) const;
746 746
747 /** 747 /**
748 * Checks whether this shortcut contains a sequence that starts 748 * Checks whether this shortcut contains a sequence that starts
749 * with the given key. 749 * with the given key.
750 * @param key the key to check 750 * @param key the key to check
751 * @return true if a key sequence starts with the key 751 * @return true if a key sequence starts with the key
752 */ 752 */
753 //USbool contains( const KKeyNative& key ) const; 753 //USbool contains( const KKeyNative& key ) const;
754 754
755 /** 755 /**
756 * Checks whether this shortcut contains the given sequence. 756 * Checks whether this shortcut contains the given sequence.
757 * @param keySeq the key sequence to check 757 * @param keySeq the key sequence to check
758 * @return true if the shortcut has the given key sequence 758 * @return true if the shortcut has the given key sequence
759 */ 759 */
760 //USbool contains( const KKeySequence& keySeq ) const; 760 //USbool contains( const KKeySequence& keySeq ) const;
761 761
762 /** 762 /**
763 * Sets the @p i'th key sequence of the shortcut. You can not introduce 763 * Sets the @p i'th key sequence of the shortcut. You can not introduce
764 * gaps in the list of sequences, so you must use an @i <= @ref count(). 764 * gaps in the list of sequences, so you must use an @i <= @ref count().
765 * Also note that the maximum number of key sequences is @ref MAX_SEQUENCES. 765 * Also note that the maximum number of key sequences is @ref MAX_SEQUENCES.
766 * @param i the position of the new key sequence(<= @ref count(), 766 * @param i the position of the new key sequence(<= @ref count(),
767 * <= @ref MAX_SEQUENCES) 767 * <= @ref MAX_SEQUENCES)
768 * @param keySeq the key sequence to set 768 * @param keySeq the key sequence to set
769 * @return true if successful, false otherwise 769 * @return true if successful, false otherwise
770 */ 770 */
771 //USbool setSeq( uint i, const KKeySequence& keySeq ); 771 //USbool setSeq( uint i, const KKeySequence& keySeq );
772 772
773 /** 773 /**
774 * Appends the given key sequence. 774 * Appends the given key sequence.
775 * @param keySeq the key sequence to add 775 * @param keySeq the key sequence to add
776 * @return true if successful, false otherwise 776 * @return true if successful, false otherwise
777 * @see setSeq() 777 * @see setSeq()
778 * @see MAX_SEQUENCES 778 * @see MAX_SEQUENCES
779 */ 779 */
780 //USbool append( const KKeySequence& keySeq ); 780 //USbool append( const KKeySequence& keySeq );
781 781
782 /** 782 /**
783 * Appends the given key 783 * Appends the given key
784 * @param spec the key to add 784 * @param spec the key to add
785 * @return true if successful, false otherwise 785 * @return true if successful, false otherwise
786 * @see setSeq() 786 * @see setSeq()
787 * @see MAX_SEQUENCES 787 * @see MAX_SEQUENCES
788 * @since 3.2 788 * @since 3.2
789 */ 789 */
790 //USbool append( const KKey& spec ); 790 //USbool append( const KKey& spec );
791 791
792 /** 792 /**
793 * Appends the sequences from the given shortcut. 793 * Appends the sequences from the given shortcut.
794 * @param cut the shortcut to append 794 * @param cut the shortcut to append
795 * @return true if successful, false otherwise 795 * @return true if successful, false otherwise
796 * @see MAX_SEQUENCES 796 * @see MAX_SEQUENCES
797 * @since 3.2 797 * @since 3.2
798 */ 798 */
799 //USbool append( const KShortcut& cut ); 799 //USbool append( const KShortcut& cut );
800 800
801 /** 801 /**
802 * Converts this shortcut to a key sequence. The first key sequence 802 * Converts this shortcut to a key sequence. The first key sequence
803 * will be taken. 803 * will be taken.
804 */ 804 */
805 //USoperator QKeySequence () const; 805 //USoperator QKeySequence () const;
806 806
807 /** 807 /**
808 * Returns a description of the shortcut as semicolon-separated 808 * Returns a description of the shortcut as semicolon-separated
809 * ket sequences, as returned by @ref KKeySequence::toString(). 809 * ket sequences, as returned by @ref KKeySequence::toString().
810 * @return the string represenation of this shortcut 810 * @return the string represenation of this shortcut
811 * @see KKey::toString() 811 * @see KKey::toString()
812 * @see KKeySequence::toString() 812 * @see KKeySequence::toString()
813 */ 813 */
814 //USQString toString() const; 814 //USQString toString() const;
815 815
816 /** 816 /**
817 * @internal 817 * @internal
818 */ 818 */
819 QString toStringInternal( const KShortcut* pcutDefault = 0 ) const 819 QString toStringInternal( const KShortcut* /*pcutDefault*/ = 0 ) const
820 { 820 {
821 return "EMPTY IMPL."; 821 return "EMPTY IMPL.";
822 } 822 }
823 823
824 /** 824 /**
825 * Returns a null shortcut. 825 * Returns a null shortcut.
826 * @return the null shortcut 826 * @return the null shortcut
827 * @see isNull() 827 * @see isNull()
828 * @see clear() 828 * @see clear()
829 */ 829 */
830 //USstatic KShortcut& null(); 830 //USstatic KShortcut& null();
831 831
832//US protected: 832//US protected:
833 //USuint m_nSeqs; 833 //USuint m_nSeqs;
834 //USKKeySequence m_rgseq[MAX_SEQUENCES]; 834 //USKKeySequence m_rgseq[MAX_SEQUENCES];
835 835
836//US private: 836//US private:
837 //USclass KShortcutPrivate* d; 837 //USclass KShortcutPrivate* d;
838 //USfriend class KKeyNative; 838 //USfriend class KKeyNative;
839 839
840//US#ifndef KDE_NO_COMPAT 840//US#ifndef KDE_NO_COMPAT
841//US public: 841//US public:
842 //USoperator int () const { return keyCodeQt(); } 842 //USoperator int () const { return keyCodeQt(); }
843//US#endif 843//US#endif
844}; 844};
845 845
846#endif // __KSHORTCUT_H 846#endif // __KSHORTCUT_H