;;; uko-custom.el -- customization options of UKO-II

;; Copyright (C) 2003 Michael Kuehn, Universität Koblenz-Landau

;; Author: Michael Kuehn <kuehn@uni-koblenz.de>
;; Maintainer: Michael Kuehn <kuehn@uni-koblenz.de>
;; Created: March 2003
;; 
;; $Id: uko-custom.el,v 1.3 2004/07/26 08:43:59 rriipp Exp $

;;;; UKO_CUSTOM


;;;; Contains all the custom variables and their setfunctions if necessary
;;;; The order of the variables appearence in this file is significant for
;;;; their appearance in Emacs' Option Menu
;;;; ------------------------------------------------------------------------

;; Add a new UKO customizaton group to the Emacs WP group
(custom-add-to-group 'emacs 
  (defgroup uko nil "The ambigous keyboard text entry system UKO-II")
  'custom-group
)

;; Add a new UKO customizaton group to the Emacs WP group
(custom-add-to-group 'uko
  (defgroup tastenselektion nil "The ambigous keyboard text entry system UKO-II")
  'custom-group
)

;;Customizable global variables
;;
;;(defcustom diff-command "diff"
;;       "*The command to use to run diff."
;;       :type '(string)
;;       :group 'diff)


(defcustom uko-dictionary-file "dict/ukodict.txt"
  "Name of the file containing the dictionary." 
  :type '(file :must-match t) :group 'uko
)


(defcustom uko-proposal-preview-num 3
  "Number of matches that are shown successively at the beginning of retrieval."
  :type '(number) :group 'uko
)


(defcustom uko-proposal-block-size 5
  "Size of block that is selected if more than MATHCES-PREVIEW-NUM matches are available."
  :type '(number) :group 'uko 
)


(defcustom uko-expand-after-each-letter t
  "When set to true, UKO-II makes a proposal after each letter"
  :type '(boolean) :group 'uko
)


(defcustom uko-insert-best-guess t
  "When T, the best guess is inserted into text buffer instead of the code numbers."
  :type '(boolean) :group 'uko
  )


(defcustom uko-partial-complete nil 
  "Partial completion flag."
  :type '(boolean) :group 'uko
)


;; Old description: "Should be true if the sockspeak speech server is available."
(defcustom uko-use-logox nil
  "Set this variable to true if you want to use the speech server."
  :type '(boolean) :group 'uko
)


;; Old description: "If true, UKO-II speaks each word after typing."
(defcustom uko-speak-each-word nil
  "Set this variable to true if you want uko-speech to speak each word when selected."
  :type '(boolean) :group 'uko
)


(defcustom uko-option-delete-code-word t
  "If true, UKO-DELETE-CODE will delete whole word, otherwise only last code char."
  :type '(boolean) :group 'uko 
)


(defcustom uko-window-size-min 65
  "Minimal size (columns) of the whole interface."
  :type '(number) :group 'uko
) 


;; setfunction for custom variable uko-scanning. Activates scanning, if uko-scanning is true
(defun uko-custom-set-scanning (s v)
  "Setfunction for custom variable uko-scanning. Activate scanning, if uko-scanning set to true."
  (if uko-initialized
    (if v
	(uko-scanning-on)
      (uko-scanning-off)
      )
    (setq uko-scanning v)
    )
  )


;; define variable for scanning mode
(defcustom uko-scanning nil
  "Activate/deactivate Scanning."
  :type '(boolean) :group 'tastenselektion
  :set 'uko-custom-set-scanning
)


;; define a physical switch on the keypad number 7
;; this button will change the current position of the hilighted and active button
;; of the UKO-II keymap
;; tells button 'b' which button of the UKO-II keymap to refer to
(defcustom uko-scanning-physical-switch-move [(kp-7)]
  "Button for scanning (switching buttons.)"
  :type '(string) :group 'tastenselektion
)


;; define a physical switch on the keypad number 7
;; this button will execute the active UKO-II button and all assigned functions
(defcustom uko-scanning-physical-switch-strike [(kp-9)]
  "Button for scanning (action.)"
  :type '(string) :group 'tastenselektion
)


;; variable defining the background-highlight-color for the active button.
(defcustom uko-scanning-hilight-color "yellow"
  "Color of active buttons."
  :type '(string) :group 'tastenselektion
)


;; variable defining the backgroud-color for the non-active buttons.
(defcustom uko-scanning-default-color "white"
  "Color of non-active buttons."
  :type '(string) :group 'tastenselektion
)


;; setfunction for custom variable uko-scanning-single-button. Activates automatic scanning, if variable is true.
(defun uko-custom-set-single-button-scanning (s v)
  "Activate single button scanning, if uko-scanning-single-button set to true."
  (if uko-initialized
    (if v
	(uko-scanning-single-button-on)
      (uko-scanning-off)
      )
    (setq uko-scanning-single-button v)
    )
  )


;; define variable for automatic scanning mode
(defcustom uko-scanning-single-button nil
  "Activate/deactivate single button scanning."
  :type '(boolean) :group 'tastenselektion
  :set 'uko-custom-set-single-button-scanning
)


(defcustom uko-scanning-single-button-delay-time 1
  "Amount of time between button change for single button scanning."
  :type '(number) :group 'tastenselektion
)


;; setfunction for custom variable uko-dual-select. Activates dual-select, if uko-dual-select is true
(defun uko-custom-set-dual-select (s v)
  "Setfunction for custom variable uko-dual-select. Activates dual-select, if uko-dual-select is true."
  (if uko-initialized
    (if v
	(uko-dual-select-on)
      (uko-dual-select-off)
      )
    (setq uko-dual-select v)
    )
  )


;; define variable for scanning mode
(defcustom uko-dual-select nil
  "Activate/deactivate dual select mode."
  :type '(boolean) :group 'tastenselektion
  :set 'uko-custom-set-dual-select
)


;; define the background color to highlight the left of the selection
(defcustom uko-dual-select-hilight-color-left "blue"
  "Color of the button(s) on the left for dual select."
  :type '(string) :group 'tastenselektion
)


;; define the foreground color (font color) of the left side
(defcustom uko-dual-select-font-color-left "white"
  "Font color of the button(s) on the left for dual select."
  :type '(string) :group 'tastenselektion
  )


;; define the background color to highlight the right of the selection
(defcustom uko-dual-select-hilight-color-right "yellow"
  "Color of the button(s) on the right for dual select."
  :type '(string) :group 'tastenselektion
)


;; define the foreground color (font color) of the right side
(defcustom uko-dual-select-font-color-right "black"
  "Font color of the button(s) on the right for dual select."
  :type '(string) :group 'tastenselektion
)


;; define a mouse-face for the uko-buttons when the mouse moves over the buttons
(defcustom uko-button-mouse-face 'uko-default-face
  "Face when the mouse pointer is over a button."
  :type 'face :group 'uko
  )


;; used by "defcustom uko-language"
;(defun uko-lang-init (s v)
;  "calls the UKO-INIT-LANGUAGE function with the language-index as parameter"
;  ; TODO: klappt noch nicht:
;  ;(uko-init-language)
;  (setq s v)
;  )


;; the customizable language setting
(defcustom uko-language 1
  "The index of language that is used by the UKO-II interface (1 = german, 2 = english)"
  :type '(number) 
  :group 'uko 
  )


