Information For Developers And Advanced Users
Prev

Appendix A. Information For Developers And Advanced Users

Table of Contents

DCOP Reference

KNewsTicker features a currently rather extensive, and steadily growing DCOP interface. This is not only used to communicate with other applications, it makes it possible to control KNewsTicker with a shell script as well. The more the interface is extended, the more useful it will become and the more flexible KNewsTicker will be controllable from a script.

To use these DCOP functions you can either use the dcop commandline program or use the more convenient KDCOP application. Both provide the same functionality so it's actually just a matter of taste which program you prefer. :-)

This chapter assumes that you're using the commandline program dcop. To access KNewsTicker's DCOP functions make sure that KNewsTicker is started and then just enter something like this at the console:

% dcop knewsticker KNewsTicker [function]

Note

If an error appears that tells you that dcop couldn't be found or executed, please check whether the file dcop exists in $TDEDIR/bin and make sure its permissions are set appropriately.

In that command line, just replace “[function]” with the appropriate function name, that is, type

% dcop knewsticker KNewsTicker updateNews

to make KNewsTicker check for new news items and download them if necessary.

DCOP Reference

In this section, all methods which are accessible via KNewsTicker's DCOP interface are listed.

updateNews

This function forces KNewsTicker to update the internal list of articles (that is, it queries the list of news sources which has been configured for new news) and downloads them when necessary.

Note

This also works if KNewsTicker is currently in offline mode.

Example:

			% dcop knewsticker KNewsTicker updateNews
		
reparseConfig

The reparseConfig command makes KNewsTicker reload its configuration from the configuration file. This function is used by the configuration dialog to talk to KNewsTicker but you can use it if you modified the configuration file by hand.

Tip

The configuration file is saved in ~/.trinity/share/config/knewsticker_appletrc

Example:

			% dcop knewsticker KNewsTicker reparseConfig
		
setOfflineMode [bool]

You can call this function to define whether KNewsTicker is currently in the offline mode (that is, whether KNewsTicker should query the configured news sites for new news).

Example:

			% dcop knewsticker KNewsTicker setOfflineMode true
		

to enable the offline mode, or type

			% dcop knewsticker KNewsTicker setOfflineMode false
		

to disable offline mode.

interval

Returns the currently configured news query interval in minutes.

Example:

			% dcop knewsticker KNewsTicker interval
			30
			%
		
scrollingSpeed

Returns the currently configured scrolling speed. The returned scrolling speed is specified in pixels per second.

Example:

			% dcop knewsticker KNewsTicker scrollingSpeed
			20
			%
		
mouseWheelSpeed

Returns the number of pixels the scrolltext gets shifted per mousewheel step.

Example:

			% dcop knewsticker KNewsTicker mouseWheelSpeed
			15
			%
		
scrollingDirection

Returns an integer which corresponds to the direction the scrolltext is scrolling in:

  • 1 = To the left

  • 2 = To the right

  • 3 = Upwards

  • 4 = Downwards

  • 5 = Upwards, rotated

  • 6 = Downwards, rotated

Example:

			% dcop knewsticker KNewsTicker scrollingDirection
			1
			%
		
customNames

Returns either 'true' or 'false', depending on whether KNewsTicker uses custom names for the news sites.

Example:

			% dcop knewsticker KNewsTicker customNames
			false
			%
		
endlessScrolling

Returns either 'true' or 'false', depending on whether KNewsTicker has the endless scrolling option enabled.

Example:

			% dcop knewsticker KNewsTicker endlessScrolling
			true
			%
		
scrollMostRecentOnly

Returns either 'true' or 'false', depending on whether KNewsTicker currently only scrolls the most recent headlines for each news site.

Example:

			% dcop knewsticker KNewsTicker scrollMostRecentOnly
			false
			%
		
offlineMode

Returns either 'true' or 'false', depending on whether KNewsTicker is currently in offline mode.

Example:

			% dcop knewsticker KNewsTicker offlineMode
			false
			%
		
underlineHighlighted

Returns either 'true' or 'false', depending on whether KNewsTicker was told to underline the headline which is currently below the mouse cursor.

Example:

			% dcop knewsticker KNewsTicker underlineHighlighted
			true
			%
		
showIcons

Returns either 'true' or 'false', depending on whether KNewsTicker currently shows the icon of the news site each particular headline was published at in front of the headline.

Example:

			% dcop knewsticker KNewsTicker showIcons
			true
			%
		
slowedScrolling

Returns either 'true' or 'false', depending on whether KNewsTicker has the “slowed scrolling” feature activated.

Example:

			% dcop knewsticker KNewsTicker slowedScrolling
			false
			%
		
foregroundColor

Returns the currently configured foreground color as a string in the format “#rrggbb”, where “rr”, “gg” and “bb” are two-digit hexadecimal values representing the intensity of the red, green and blue components in a scale of 00-ff.

Example:

			% dcop knewsticker KNewsTicker foregroundColor
			#804000
			%
		
backgroundColor

Returns the currently configured background color as a string in the format “#rrggbb”, where “rr”, “gg” and “bb” are two-digit hexadecimal values representing the intensity of the red, green and blue components in a scale of 00-ff.

Example:

			% dcop knewsticker KNewsTicker backgroundColor
			#0030ff
			%
		
highlightedColor

Returns the currently configured highlight color as a string in the format “#rrggbb”, where “rr”, “gg” and “bb” are two-digit hexadecimal values representing the intensity of the red, green and blue components in a scale of 00-ff.

Example:

			% dcop knewsticker KNewsTicker highlightedColor
			#000080
			%
		
newsSources

Returns the list of currently registered news sources. Note that this returns all news sources, not just the selected ones. In the output, each news source name will be printed on a line.

Example:

			% dcop knewsticker KNewsTicker newsSources
			Freshmeat
			GNOME News
			dot.kde.org
			Slashdot.org
			%
		
Prev
Home


Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team